I am writing this to a .txt file.
The problem here is that it doesn´t compile when I write "\".
Why does this happening because this is just a string ?
I really need to get this "\" out to the file. Any idéas on this ?

ofstream out;
out.open("C:\\File.txt")

out << "Some Text" << "\" << '\n';

use two '\' characters similiar to how you did it in the open statement. out << "Some Text" << "\\" << '\n';

Thank you for that, I was almost afraid it wasn´t possible. So it is the same as path searching in a way.

use two '\' characters similiar to how you did it in the open statement. out << "Some Text" << "\\" << '\n';

In order to print the '\' character you have to use two of those little boogers.

Yes, I will remember that now :)

In order to print the '\' character you have to use two of those little boogers.

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.