https://zellwk.com/blog/asking-questions/
Please be more specific. What does
not work mean? Does it not compile? Does it crash? Does it just show an empty console?
Because I'm training to be a psychic, I am going to assume that your file is opening correctly in CB (which I happen to know stands for Code::Blocks, also due to my psychic abilities), but incorrectly in Visual Studio 2010.
• Code::Blocks, if I'm not mistaken, has its
working directory as the same directory that your project file is in, by default.
• Visual Studio, on the other hand, has its
working directory as the same directory that your .exe file is output into, by default.
Make sure you place your DATA.txt in the appropriate folder.
To see what directory your program is being run from, add the following line of code to the beginning of your program:
system("cd"); // only use for testing purposes