Skip to content

Instantly share code, notes, and snippets.

@Wollw
Created February 29, 2012 04:33
Show Gist options
  • Save Wollw/1937783 to your computer and use it in GitHub Desktop.
Save Wollw/1937783 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
void change_array(int a[], int i, int n) {
a[i] = n;
}
int main() {
int a[] = {1,2,3,4,5,6};
change_array(a, 3, 789);
cout << a[3] << endl; // Outputs "789"
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment