Here's a simple program that uses a pointer. The program compiles but issues this warning. The compiler I use is gcc.
gcc -g -ansi -pedantic -Wall ex9-2-4.c -o ex9-2-4
ex9-2-4.c: In function 'main':
ex9-2-4.c:12 warning: int format, pointer arg (arg 2)
Here's the code.
What conversion specifier do I use for pointers?Code:/* ex9-2-4.c */ #include <stdio.h> int main(void) { int cost, *p_cost; p_cost = &cost; cost = 100; printf("\nPointer value: %d, points at value: %d\n\n", p_cost, *p_cost); return 0; }
P.S. If this question has been asked before on this message board, I'd appreciate someone giving me a link to the appropriate post. Thanks.