Expert help, a very simple question
Users questions:I just learn C Will the following program where the wrong # definePRICE30main () (intnum, total; num = 10; total = num * PRICE; printf ( "total =% d", total);) wrongIn the sixth line, but I do not know specifically where, please Zhijiao 1
Experts answer: # definePRICE30 ** here for PRICE and 30 less a space between, the compiler that you are defined by a constant PRICE30, but this does not mean that nothing constant these words of the languageLaw and no errors, compile time is fully capable to pass normally, but to the following statement must Problems. ** main () (intnum, total; num = 10; total = num * PRICE; ** relatively constant in front of the definition quoted here, PRIn fact, there is no definition in front of ICE, I think you must compile error "PRICE variable is undefined." But there can not write PRICE30, because PRICE30 it does not mean anything, if it is used and the NUM, or multiplication will complain ** printf ( "total=% d ", total);) Recommendation: in the preparation of C language programs, when an attentive, especially the spaces, semicolons these small places. and troubleshooting of the time to 22 correspond to view, this experience for the constants and variables the definition and use it with the usefulness of