Weird error in c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
22nd Jul 2019, 11:55 PM
InvBoy [ :: FEDE :: ]
InvBoy [ :: FEDE :: ] - avatar
5 Answers
+ 5
Yes, EOF cannot be used as a variable name. This gives no error. https://code.sololearn.com/c481heYrdrYO/?ref=app
23rd Jul 2019, 12:26 AM
Sonic
Sonic - avatar
+ 6
Thanks Sonic and Agent_I
23rd Jul 2019, 1:45 AM
InvBoy [ :: FEDE :: ]
InvBoy [ :: FEDE :: ] - avatar
+ 5
The problem is the EOF variable. EOF is a macro definition with value of -1. Declaring varible with that will cause error
23rd Jul 2019, 12:13 AM
Agent_I
Agent_I - avatar
+ 3
EOF can't be used because it's predefined. EOF - end of file.
24th Jul 2019, 3:12 AM
Manoj
Manoj - avatar
+ 2
Keyword cant be used as variable (key points) Just confused the compiler pity compiler😆😆😆
25th Jul 2019, 10:20 PM
Rohit