Herbalizer
Programmer
/*
For some reason the following code does not print
the first line of the txt file. I'm pretty sure
the code is right, dont know if its my compiler
or what not. I'm using dev-c++. Any suggestions
are welcome.
*/
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;
int main () {
char read[100][50];
ifstream input;
input.open("c:\temp.txt");
input.getline(read[0], 50);
cout << endl << read[0] << endl;
system("PAUSE");
return 0;
}
For some reason the following code does not print
the first line of the txt file. I'm pretty sure
the code is right, dont know if its my compiler
or what not. I'm using dev-c++. Any suggestions
are welcome.
*/
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
using namespace std;
int main () {
char read[100][50];
ifstream input;
input.open("c:\temp.txt");
input.getline(read[0], 50);
cout << endl << read[0] << endl;
system("PAUSE");
return 0;
}