Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ledi001 on October 22, 2018, 03:39:06 pm

Title: How can i show an address of a variable in an easy way?
Post by: ledi001 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?
Title: Re: How can i show an address of a variable in an easy way?
Post by: oBFusCATed 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?
Title: Re: How can i show an address of a variable in an easy way?
Post by: ledi001 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?
Title: Re: How can i show an address of a variable in an easy way?
Post by: oBFusCATed 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.