This preview shows page 1. Sign up to view the full content.
Unformatted text preview: COP 3275 C Language Special Notes #1 1. GCC with math.h If youre using pow() function of math.h library to do the programming assignment #1, and you tried to use gcc to compile it, like gcc -Wall poly.c, you might get this compilation error: undefined reference to `pow' . This error is not about your code, but you have to add -lm parameter when you compile, like gcc -Wall -lm poly.c. This tells the gcc compiler to link the math library when compile. Otherwise, it wont find the pow() function. This situation will not be seen when youre using Visual Studio or Eclipse. 2. Scanf with Eclipse on Windows If you write a program using the printf and scanf functions in eclipse on Windows , it might compile correctly, but when you run it in the eclipse console area, it will not function properly. The scanf might ask for the input before any printf can display some message. After you finished with the input, the printf message will show up, even though it was supposed to come...
View Full Document
- Fall '11