RSS
Follow Us
Contribute
 
 
 
 

Error C2017: illegal escape sequence

 
We need YOUR SKILLS in this collaborative work, to build the largest solution center for error messages.

From $1

Table of contents
  1. 1. Cause
  2. 2. Solution

Cause

If a newline character '\n' is written after the constant and quotaation marks in Visual C++, then this error message is generated. Arbitrarily added newline character will also generate this error. Ex:

string a = "abcde"\n;	// This line will generate C2017.
\n			// This line will generate C2017 too.

Solution

Put the newline character '\n' in the string or character constant and remove other unnecessary newline characters.

string a = "abcde\n";
 
 
 
 
Comments