Created
October 29, 2011 19:37
-
-
Save masak/1324972 to your computer and use it in GitHub Desktop.
C variables have to be declared
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
$ 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