I get this strange error compiling this program. I think there was a compiler parameter that fixed this but it's been years since I've used C. Does anyone know? I'm using Ubuntu Linux.
Code:#include <stdio.h> void cybeByReference( int * ); int main() { int number = 5; printf( "The original value of number is %d", number ); cubeByReference( &number ); printf( "\nThe new value of number is %d\n", number ); return 0; } void cybeByReference( int *nPtr ) { *nPtr = *nPtr * *nPtr * *nPtr; }
Code:eugene@eugene-laptop:~/cfiles$ cc -Wall -pedantic fig07_07.c fig07_07.c: In function ‘main’: fig07_07.c:10: warning: implicit declaration of function ‘cubeByReference’ /tmp/cck2bZ1N.o: In function `main': fig07_07.c:(.text+0x32): undefined reference to `cubeByReference' collect2: ld returned 1 exit status



LinkBack URL
About LinkBacks



