Dear all , I tried to programe a scanner that scans a text file and tables the tokens inside , but my scanner can't see the spaces and the end lines
my simple code tries to open the file and look inside for printing it on screen .
please what can I do for this ?
Code:
#include < iostream.h>
#include < fstream.h >
#include < string.h >
void main()
{
char d;
ifstream input("c:\\test\\Data_file.txt");
if ( !input.is_open() )
cout << "the file couldn't be opened !" ;
else cout << "the file is opend successfully !" ;
cout << endl;
for(int i=0 ; i<50; i++)
{
//input.seekg(i,ios::beg);
input >> d;
cout << d;}
}
thank you all.