-1

Need to identify why is my Variable named content showing junk characters as "ÿþE".

Below is my code :

std::ifstream ifs("D:\vstudio\ConsoleApplication3\DebugExport_20190617090328.txt");

std::string content(
    (std::istreambuf_iterator<char>(ifs)),
    std::istreambuf_iterator<char>()
);
Evg
  • 20,870
  • 4
  • 34
  • 69
MTV
  • 1
  • 3

1 Answers1

-4

some operations like cout convert string into signed char*. signed char cannot show special letters like é, î, ², ~ and many others. Then they are converted into some strange letters like these you mentioned above.

  • This is not an answer, kindly go through how to answer section of StackOverflow. Also this is a solvable error that the user has asked. – anand_v.singh Jan 22 '20 at 04:17