程序中往往回出现这样的情况:程序不能确定它已经读入的输入是否足够,除非超前多读入一些输入。例如,把读入一些字符以合成一个数字的情况:看到一个非数字字符之前,已经读入的数的完整性是不能确定的。
程序如下:
/*
函数getop()是用来获取下一个运算符或操作数。该函数实现起来比较容易。它需要跳过空格与制表符
程序中往往回出现这样的情况:程序不能确定它已经读入的输入是否足够,除非超前多读入一些输入。例如,把读入一些字符以合成一个数字的情况:看到一个非数字字符之前,已经读入的数的完整性是不能确定的。
程序如下:
/*
函数getop()是用来获取下一个运算符或操作数。该函数实现起来比较容易。它需要跳过空格与制表符