How can write out rep sign (\) ?

cout << "???";

Recommended Answers

All 3 Replies

the character '\' ? it would be

cout<<'\\'<<endl; //just the single character
cout<<"c:\\someFile"<<endl; //used as part of a string
//second prints to console "c:\someFile"

edit: ..... beaten to the punch again :'( lols

string str="\\";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.