hi all,
i am done with my project for lexeme but i only worked on cpp, i wonder that can i make my header file based on my cpp file?
thank you
this is my code
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main ()
{
char a;
string str = "";
ifstream file ("sample.txt",ios::in);
if(!file)
{
cout<<"Unable to open the file!!!" <<endl;
exit(1);
}
file >> a;
while (file)
{
if (a == '/' ||a == '*' ||a == '+' ||a == '-' ||a == ';' ||a == '^'||a == '='||a == '('||a == ')')
{cout << a << " symbol" << endl ;
file >> a;}
else {str = a;file >> a;
while( a >= '0' && a <= '9' || a == '.')
{
str.append(1,a);
file >> a;
}
cout << str << " number" <<endl ;
str = "";
}
}
file.close();
return 0;
}