Sunday, July 12, 2009

C++ help.....?

how do i create a loop to get a set of unknown integer values that are stored in an input file?


here is what i have so far. am i on the right track. can someone show an example of how i am suspose to do it.





#include%26lt;iostream%26gt;


#include%26lt;fstream%26gt;





using namespace std;





int main()


{


ifstream input;


double number;





input.open("inputFile-1.txt");





while (input)


{

C++ help.....?
int m;


cin%26gt;%26gt;m;


// you can also store them in an array


}
Reply:read the file till you hit the end of file.


No comments:

Post a Comment