Hey guys I need some help with a problem.. I'm trying to read from a simple txt file and it says I'm missing dll files and the txt file contents doesn't display to the console.
//Reading Files
#include<iostream>
#include<fstream>
#include<string>
usingnamespace std;
int main()
{
string text = "";
ifstream textfile("text.txt");
//cheek to see if file was opened
if (textfile.is_open())
{
//loop while we are not at the end of file
while (!textfile.eof());
{
string tempString;
textfile >> tempString;
text += tempString;
}
textfile.close();
}
else
{
cout << "ERROR: could not open file" << endl;
}
cout << text << endl;
system("pause");
return 0;
}
My Error:
1 2 3 4 5 6
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp120d.dll'. Cannot find or open the PDB file.
'Tutorial_Reading_Files.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr120d.dll'. Cannot find or open the PDB file.
The thread 0x1ad0 has exited with code -1073741510 (0xc000013a).
Well, about the warnings, they're not saying you are missing .dll files, they're saying the compiler can't find the PDB files. See here: http://stackoverflow.com/questions/4813975/why-is-visual-studio-2010-not-able-to-find-open-pdb-files .
You have a semicolon at the end of your while statement, which will execute an infinite loop.