Hi.
If you read a file and a line like this:
Code:ifstream A ( "Startup.txt" ); if ( A.is_open() ){ A.getline( ThePassword, 100 );//The first line of the file is the string ThePassword, //it automaticly after reading make's some kind of endl; after reading that line //But now I want that he reads the value of int Check1; //If I enter A.getline( Check1 ); it gives me a compile error, proberly getline is for strings not for int; //So I thought of A>> Check1; but the problem is that if you read another line //it wont read the line under A>> Check1; but the same line because he doesn't do an endl; after reading //So is there some skipline(); thing or >>endl; thing, that after reading A>> Check1; that he goes to the next //line and he read's that next line? Any help is welcome, here is the whole read/write code so far: ifstream A ( "Startup.txt" ); if ( A.is_open() ){ A.getline( ThePassword, 100 ); A>> Check1; A.getline( TheConfirmCode, 100 ); A>> Check2; A.close(); }//This doesn't work :( ofstream B ( "Startup.txt" ); B<< ThePassword<<endl; B<< Check1<<endl; B<< TheConfirmCode<<endl; B<< Check2<<endl; B.close();//This does work because of B<< Check1<<endl;



LinkBack URL
About LinkBacks


