Skip to content

Instantly share code, notes, and snippets.

@bew
Last active March 24, 2017 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bew/c78f06aaaaa2d37c3c02291d7cec58ee to your computer and use it in GitHub Desktop.
Save bew/c78f06aaaaa2d37c3c02291d7cec58ee to your computer and use it in GitHub Desktop.
pass array literal in C to function
#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