I have a n X 2 matrix stored in a text file as it is. I try to read it in C++
nb_try=0; fin>>c_tmp>>gamma_tmp; while (!fin.eof( )) //if not
IIRC, the eofbit doesn't get set until you actually try to read past the end of the file. That is, once you reach the end of the file, you have to read one more time before that flag will be set.