Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no way around it?

Status
Not open for further replies.

Neoyanderson

Programmer
Apr 18, 2004
16
US
df_%s_%t_%p

im trying to put the above as it is in a CString (VC++) but when i do so, I get a runtime error for obvious reasons. what do i do? is there a syntax thing im missing to make the %s, %t, %p purely characters?
 
Try \% (\ means next character taken literally).

Vincent
 
nope i get the warning that the character is not recognized as an escape
 
TimmayNxxx [LOL], don't forget you're working in C++,
Mister Anderson, I can't understand what is your problem, could you be a bit more specific?
Look, I've tried your code as I understood:

CString x("df_%s_%t_%p");
cout<< "hello world\nthis is x: "<< x<< endl;

and this is the output:
hello world
this is x: df_%s_%t_%p

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top