Hi, my name is Amarendra..
I am building a parser for CAD translator.. My parser right now can parse integer numbers easily. But it has a problem while reading float number. Could anybode please help me.
The code is as follows.
I am building a parser for CAD translator.. My parser right now can parse integer numbers easily. But it has a problem while reading float number. Could anybode please help me.
The code is as follows.
Code:
if (isdigit(ch))
{
int num=0;
do
{
//no checking for overflow
num=10 * num + ch - '0';
}while((ch = read_ch())!=EOF && isalnum (ch));
put_back(ch);
return num;
}
}
Comment