Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

niggling thought...

Status
Not open for further replies.

mrutherford

Programmer
Sep 5, 2003
6
GB
this may seem trivial, but its been bothering me for a while:
if a variable is defined outside of a method/function in a cpp source file, where is it located, on the heap or where?

cheers
 
It is on the stack. It has "file local" scope. However if you mean a #define symbol then it is in the/a data segment.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top