Skip to content

Instantly share code, notes, and snippets.

@masak
Created October 29, 2011 19:37
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 masak/1324972 to your computer and use it in GitHub Desktop.
Save masak/1324972 to your computer and use it in GitHub Desktop.
C variables have to be declared
$ cat example.c
main() {
undeclared_variable = 42;
}
$ cc example.c
example.c: In function ‘main’:
example.c:2:3: error: ‘undeclared_variable’ undeclared (first use in this function)
example.c:2:3: note: each undeclared identifier is reported only once for each function it appears in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment