-
-
Save bew/c78f06aaaaa2d37c3c02291d7cec58ee to your computer and use it in GitHub Desktop.
pass array literal in C to function
This file contains 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
#include <stdio.h> | |
int func(const int bla[3]) | |
{ | |
return bla[0]; | |
} | |
int main() | |
{ | |
printf("%d\n", func( (const int[3]){42, 43, 44} )); // => 42 | |
return (0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment