Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 723 Bytes

File metadata and controls

36 lines (27 loc) · 723 Bytes
title Compiler Error C2017
description Learn more about: Compiler Error C2017
ms.date 06/01/2026
f1_keywords
C2017
helpviewer_keywords
C2017

Compiler Error C2017

unknown escape sequence

Remarks

An escape sequence, such as \t, appears outside of a character or string constant.

Examples

The following example generates C2017:

// C2017.cpp
int main() {
   char test1='a'\n;   // C2017
   char test2='a\n';   // ok
}

C2017 can occur when the stringize operator is used with strings that include escape sequences.

The following example generates C2017:

// C2017b.cpp
#define TestDfn(x) AfxMessageBox(#x)
TestDfn(CString("\\") + CString(".h\"\n\n"));   // C2017