User forums > Using Code::Blocks

Call stack window

(1/2) > >>

Vadim:
Can anyone please tell what does the second column in Call stack window named "Address" show?

BlueHazzard:
The address of the function?

Vadim:
I really hoped so :),
but then in code I wrote printf("%p\n", main); and it showed different address (of main()) from that that was shown in Call stack window. I may be wrong but I just cant understand why. May you please explain it?

blauzahn:
os, cb-version, compiler, debugger, c or c++?

On my computer the address within the call-stack window shows e.g. 0x40065b depending on the instruction where you stopped whereas watch and printed value is 0x400652
(ubuntu 18.04, cb svn 11511, g++-trunk (GCC) 9.0.0 20181210, gdb (Ubuntu 8.2-0ubuntu1~18.04) 8.2, c++).

Please try debugging "step into instruction" and you see what I mean.

Please be aware that main is a somewhat special function. Some programmer even say that main is not really a function at all since it is
the designated entry point to a program. You are not supposed to call it.

https://en.cppreference.com/w/cpp/language/main_function

Vadim:
Ive attached the picture of the source code and all.
Windows 8, Code::Blocks 17.12, mingw32-g++ Compiler, gdb32 Debugger, C++.

May you, please, explain why there is a difference between addresses shown in the Call stack window and the Console?
Shouldn't they be the same?

Navigation

[0] Message Index

[#] Next page

Go to full version