2

When I try to compile my code using g++ in terminal, I get an error:
Decoder.cpp:32:1: fout: stray ‘\302’ in program
Decoder.cpp:32:1: fout: stray ‘\262’ in program

Decoder is a class that decodes lines from an inputfile. I have no idea what these errors can be. When I look on the internet, they say it has something to do with whitespaces. No clue why! I used to write empty spaces to an output file: like this out << " ";. But I never got an error untill now.

So I went to eclipse, and my code runs fine. Back to g++ and I get the same error. Any idea why?

Natan Streppel
  • 5,759
  • 6
  • 35
  • 43
user2321611
  • 1,049
  • 1
  • 7
  • 17

2 Answers2

2

You've somehow ended up with a non-ASCII character (Unicode "superscript two") in line 32 of your source. Delete that character, replace it with whatever is supposed to be there (a normal 2, perhaps? or maybe nothing?), and be careful where you copy and paste code from.

Mike Seymour
  • 249,747
  • 28
  • 448
  • 644
0

There could be invisible control character on line 32. Please rewrite the complete line. That should fix your compilation issue.

You may as well refer: https://stackoverflow.com/a/6572148/815812

Community
  • 1
  • 1
Ashwin
  • 1,942
  • 4
  • 30
  • 59