Author Topic: print address of a pointer in decimal mode.  (Read 5010 times)

Offline phR689

  • Single posting newcomer
  • *
  • Posts: 6
print address of a pointer in decimal mode.
« 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7602
    • My Best Post
Re: print address of a pointer in decimal mode.
« Reply #1 on: December 28, 2011, 09:34:45 pm »
Thank you for NOT reading the rules!

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


Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline phR689

  • Single posting newcomer
  • *
  • Posts: 6
Re: print address of a pointer in decimal mode.
« Reply #2 on: December 28, 2011, 09:38:58 pm »
ok, sorry,... you think i have to report it as a bug !
 :-[

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: print address of a pointer in decimal mode.
« Reply #3 on: December 28, 2011, 09:48:27 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 !!

Offline phR689

  • Single posting newcomer
  • *
  • Posts: 6
Re: print address of a pointer in decimal mode.
« Reply #4 on: December 28, 2011, 10:09:49 pm »
well, sorry!
i'll be a better reader!!

regards