I'm trying to read a file I text file I created in notepad. Can it read notepad files? Does the file have to be in a certain place in order for the program to find it?
My code:
My result:Code:#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
char str[100];
ifstream a_file ("hi.txt");
a_file>>str;
cout<<str<<"/n";
system("PAUSE");
return EXIT_SUCCESS;
}
α╒św< "/nPress any key to continue . . .
Whats wrong? How do I fix it?