error: stray ‘\302’ in program

For those who have already encountered this error “error: stray ‘\302’ in program” or something similar while compiling a program in C :
fool@localhost:~$ gcc -o hello_world hello_world.c

hello_world.c: In function ‘main’ :
hello_world.c:5: error: stray ‘\302’ in program
hello_world.c:5: error: stray ‘\304’ in program

Either you have to remove the entire line (here line 5), or you just have to remove some trailing characters. Sometimes, while writing into a text editor, some non-ASCII characters are inserted accidentally.

Advertisements

6 thoughts on “error: stray ‘\302’ in program

  1. Thank you man, you really help me with the subject ‘Operating Systems Design’. Very thanks I’m from Argentina.

  2. hi am using linux in Vmware when i comiling the code which shows stray error \201.202 like this pls help me

  3. 3_5_nat.c: In function ‘main’:
    3_5_nat.c:14:1: error: stray ‘\302’ in program
    3_5_nat.c:14:1: error: stray ‘\250’ in program
    3_5_nat.c:14:10: error: expected expression before ‘%’ token
    3_5_nat.c:14:10: error: stray ‘\302’ in program
    3_5_nat.c:14:10: error: stray ‘\250’ in program

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s