例3.1符号常量的使用。
#define price 30
main ( )
{
int num,total;
num=10;
total=num * price;
printf("total=%d",total);
}
程序中用#define命令行定义price代表常量30,此后凡在本文件中出现的price都代表30,可以和常量一样进行运算,程序运行结果为
total=300