Search code examples
ccommentsc89

-Ansi and comments giving errors?


I'm getting errors while compiling with -ansi -pedantic on lines that have // Comment here. Why does this happen?

expected expression before '/' token

stray '\347' in program

Example code int someVariable = 0; // Some comment

I have many many errors of these, what is it?


Solution

  • C89 does not support C++-style comments.