I wrote a small program to read my data file. But I got ridiculous numbers in xcode, but when I use the terminal, " g++ xxx.cpp". The result turns out to be all right.
The program is quite simple, I attach the one to read the first integer number of my file.
#include <iostream>
#include <fstream>
using namespace std;
int main () {
int nnodes;
fstream datafile;
datafile.open("xx.xx");
datafile >> nnodes;
cout << "nnodes=" << nnodes << "\n";
datafile.close();
}
Can anyone give me some idea about this?
Thanks a lot!
The program is quite simple, I attach the one to read the first integer number of my file.
#include <iostream>
#include <fstream>
using namespace std;
int main () {
int nnodes;
fstream datafile;
datafile.open("xx.xx");
datafile >> nnodes;
cout << "nnodes=" << nnodes << "\n";
datafile.close();
}
Can anyone give me some idea about this?
Thanks a lot!