[note] read file data to string, by char

11:00 AM at 11:00 AM

#include
#include

using namespace std;

int main()
{

ifstream inputFile;
inputFile.open("some file name here");

string number;
char digit;

while( inputFile.get( digit ) )
{

number = number + digit;

}

return 0;

}

0 comments: