Quote:Original post by Palejo error C2065: 'end1' : undeclared identifier error C2065: 'end' : undeclared identifier
|
Since those are our first errors, I would like to point out that getting acquainted to compiler error messages, their meaning and their probable cause is
fundamental. Compiler writers go out of their way to provide meaningful error messages, so
do pay attention to them, even if they're long, even if they contain unreadable alphabet soups (linker errors and template errors are particularly guilty of that), even if you aren't familiar with the terminology.
Additionally, if you're using Visual Studio, note that there is a help page for each error message, accessible via their error code (here,
C2065). If you have never seen an error, or are not sure what it means, do read the error page.
"undeclared identifier" is your compiler telling you "I have no idea what you are talking about, I've never seen it before". It often indicates a typo or, like here, that you are telling the compiler to look in the wrong place. It may also mean that you have simply forgotten to provide the declaration, either by
#includeing the appropriate header, or by writing the declaration yourself.
Finally, and I'm getting ahead a bit, know that there is a difference between a
declaration (hence 'undeclared') and a
definition. Pay close attention to what your compiler is telling you.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan