0

I'll provide an example:

Lets say I want to display this: "Purpose of \r"

I type in the global stream object cout: std::cout << "Purpose of \r";

But I end up with this displayed in the console: ""

Meho buh
  • 25
  • 4
  • 2
    If you have control over the special character then just make sure the \ doesn't get interpreted as a special character. Try `std::cout >> "Purpose of \\r";` and note the DOUBLE slash – cadolphs Aug 29 '22 at 00:59
  • 1
    Raw [string literal](https://en.cppreference.com/w/cpp/language/string_literal) might also help: `R"(Purpose of \r)"` – Jarod42 Aug 29 '22 at 06:48

0 Answers0