Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Backslash in C str

gelarimer
Beginner
794 Views

I know that the double backslash is needed in C strings to produce the literal , and that the string 'D:'Cwill producethe followingcompiler warning: "The backslash character and following character is not a
valid escape sequence"

But the following does not produce a warning, and the str seems to work fine as an arg in Win32 function calls:

'D'//':'//ACHAR(0)

Which is correct" 'D'//':'//ACHAR(0) or 'D'//':'//ACHAR(0)?

Any comments would be appreciated.

0 Kudos
2 Replies
Steven_L_Intel1
Employee
794 Views
The first is correct, but Windows is fairly tolerant of using two backslashes when one will do. The literal '' is not the same as ''C.
0 Kudos
gelarimer
Beginner
794 Views
Steve, thanksfor the quick reply.
0 Kudos
Reply