Author Topic: How can i show an address of a variable in an easy way?  (Read 2744 times)

Offline ledi001

  • Single posting newcomer
  • *
  • Posts: 2
How can i show an address of a variable in an easy way?
« on: October 22, 2018, 03:39:06 pm »
Hi,
i am not so familiar with code::blocks and i want to see the address of an existing variable.
What i found out is when i select a variable and choose with a right mouseklick "Examine memory" then i will find the address of this variable like in the attached image in the Memory window. In this case, the address of a = 0x407000 with a value of 4.

But is there no easier way to find out the address of a variable? Maybe in a column in the watch window?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can i show an address of a variable in an easy way?
« Reply #1 on: October 22, 2018, 06:38:49 pm »
Have you tried to type &myvariable and press enter in the watches window in an empty row?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ledi001

  • Single posting newcomer
  • *
  • Posts: 2
Re: How can i show an address of a variable in an easy way?
« Reply #2 on: October 22, 2018, 08:50:20 pm »
Thank you for that hint!
It works  :)

But is there a way that i can show the address of a variable automatically in a separate column in the watch window?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can i show an address of a variable in an easy way?
« Reply #3 on: October 22, 2018, 09:17:26 pm »
No, there isn't. It could be added, but it will slow the current debugger quite a bit.
Also the info for addresses is not that useful most of the times and when it is useful there is a way to achieve it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]