Code::Blocks Forums

User forums => Help => Topic started by: phR689 on December 28, 2011, 09:19:30 PM

Title: print address of a pointer in decimal mode.
Post by: phR689 on December 28, 2011, 09:19:30 PM
when i try to print the address of a pointer in a decimal mode, the compiler (GNU GCC) shows the following error.

    int age = 14;
    int *pointeurSurAge = &age;

    printf("%d", pointeurSurAge);
    return 0;

../../main.c:9:5: attention : format '%d' expects argument of type 'int', but argument 2 has type 'int *' [-Wformat

thanks for support!
:D
Title: Re: print address of a pointer in decimal mode.
Post by: stahta01 on December 28, 2011, 09:34:45 PM
Thank you for NOT reading the rules!

http://forums.next.codeblocks.org/index.php/topic,9996.0.html (http://forums.next.codeblocks.org/index.php/topic,9996.0.html)


Tim S.
Title: Re: print address of a pointer in decimal mode.
Post by: phR689 on December 28, 2011, 09:38:58 PM
ok, sorry,... you think i have to report it as a bug !
:-[
Title: Re: print address of a pointer in decimal mode.
Post by: Jenna on December 28, 2011, 09:48:27 PM
Quote from: phR689 on December 28, 2011, 09:38:58 PM
ok, sorry,... you think i have to report it as a bug !
:-[
No you should learn to read and ask your question in an appropriate forum.

Your question is not about C::B and therefore violates our forum rules !!
Title: Re: print address of a pointer in decimal mode.
Post by: phR689 on December 28, 2011, 10:09:49 PM
well, sorry!
i'll be a better reader!!

regards