Skip to content

Instantly share code, notes, and snippets.

@Costava
Created February 15, 2022 00:04
Show Gist options
  • Save Costava/ce1ed166dac4269a57b7050a2372a559 to your computer and use it in GitHub Desktop.
Save Costava/ce1ed166dac4269a57b7050a2372a559 to your computer and use it in GitHub Desktop.
// gcc ArrayParamIsNotValueType.c -std=c99 -Wall
#include <stdio.h>
void DoFoo(int a[3]) {
a[0] = 77;
a[1] = 88;
}
int main(void) {
int arr[3] = { 11, 22, 33 };
printf("arr: %d %d %d\n", arr[0], arr[1], arr[2]);// arr: 11 22 33
DoFoo(arr);
printf("arr: %d %d %d\n", arr[0], arr[1], arr[2]);// arr: 77 88 33
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment