Having issues opening a .cpp created in Visual studio in other compilers. My instructor relies on everything but visual studio, and gets garbage when opening a visual studio created cpp file.
image of visual studio created c++ file in Dev-Cpp:
Having issues opening a .cpp created in Visual studio in other compilers. My instructor relies on everything but visual studio, and gets garbage when opening a visual studio created cpp file.
image of visual studio created c++ file in Dev-Cpp:
You should check the character encoding of the .cpp file, if you used Visual Studio to create it, it may be UTF-8 with the byte order mark (BOM) sequence to the beginning of the file.
You may use a binary|hexadecimal file viewer to see if the file starts with BOM sequence.
In Visual Studio, if you want to save a file with other encodings select Save as
and extend the save button in file dialog and select Save with encoding
.
If you want to remove this setting permanently just open File menu and select Advanced save options
and there you should select UTF-8 without signature
.
See this SO question and also this other one for more information and details or alternative solutions.