> 1: Error: stray '\ 239' in program> 1: Error: stray '\ 187' in program> 1: Error: stray '\ 191' in program

Source: Internet
Author: User
Tags printable characters

When C-free is used, mingw5 is used to compile C ++ code, and the first line of error is returned:

> 1: Error: stray '\ 239' in program

> 1: Error: stray '\ 187' in program

> 1: Error: stray '\ 191' in program

Baidu found that there may be Chinese characters (such as spaces and Chinese periods). This problem still exists after all the punctuation marks in the first line are replaced by the English input method. Http://gcc.gnu.org/ml/gcc-help/2005-01/msg00272.html there is a non-printable characters in a source file under this link. It is no wonder that the problem cannot be solved after replacement, and in essence this unprintable character is Bom character.

Usually our source files use GBK or UTF Encoding, if there are Chinese characters use GBK, UTF-8 is more conducive to cross-platform. In Windows, in order to distinguish the UTF-8 encoding format, write the Three-byte mark (0xef 0xbb 0xbf) before the UTF-8-encoded text file to distinguish the UTF-8-encoded text file, that is, the UTF-8 with Bom. Some compilers in Linux do not recognize Bom, so an error is reported.

For example, if GCC can be recognized, but mingw5 cannot, three errors are displayed.

Work und: Save As a file in UTF-8 no Bom format. If the cause of the error is the comma (,) of the Chinese character entered, you must modify it one by one.

 

 

More:

Character problems also occur in Python. The most typical problem is that tabs and spaces are mixed, while the python interpreter strictly requires only one type. Therefore, when using notpad ++, pay attention to relevant settings.

 


> 1: Error: stray '\ 239' in program> 1: Error: stray '\ 187' in program> 1: Error: stray '\ 191' in program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.