Copy and Paste Error

I am getting a really weird error and wanted to know if anyone knows the proper way to fix it.

What i did:
I found and example snake program formy Esplora and TFT screen. I pasted the code into a new IDE window and started getting crazy errors when I tried to compile it.

The error:
The first error I got was about the #include. It would tell me that the #include expects <file_name>. In orderto fix Iit I had to comment/delete and on a new line retype the code exactly as it was. This got the program compiling but I started getting Stray /304 errors.

Bad solution:
After looking it up online I found that it is a copy and paste error and try to re type the problem line of code. After lots of testing ifound that this works. However, get this error on EVERY line including comments. Seems crazy to retype the entire program which in this smaller one it is doable but in a larger program that is just crazy.

Other things I tried (that failed):

  1. Copy the code into other applications, like word and note pad, then into the IDE. Unfortunately i got the same errors.
  2. Reinstall the IDE.

Anyone else get this error and have better luck fixing it?

Thanks,
John

There are probably hidden characters causing the problem. There is an option Tools > Fix Encoding & Reload in the IDE, I'm not sure whether that solves the issue but worth a try. I've seen this happen where someone copies it from a website, has that "Stray" error, then when they paste the sketch to the forum the characters are removed and the code works fine. So you could try pasting it in a message here, then do Preview and then copy it from the preview.

Thanks for the ideas. I will give thema try and let you know what happens.