mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Added example of printIntArray in C
This commit is contained in:
parent
2acf7822bd
commit
36fe7e1cce
@ -557,6 +557,12 @@ void printIntArray(int *arr, int size) {
|
||||
printf("arr[%d] is: %d\n", i, arr[i]);
|
||||
}
|
||||
}
|
||||
/*
|
||||
int my_arr[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||
int size = 10;
|
||||
printIntArray(my_arr, size);
|
||||
// will print "arr[0] is: 1" etc
|
||||
*/
|
||||
|
||||
// if referring to external variables outside function, must use extern keyword.
|
||||
int i = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user