Created
February 15, 2022 00:04
-
-
Save Costava/ce1ed166dac4269a57b7050a2372a559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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