Click here to Skip to main content
15,922,155 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: a printing question Pin
Steve S1-Mar-04 6:44
Steve S1-Mar-04 6:44 
Questionglobalalloc = RAM? Pin
shinay27-Feb-04 22:25
shinay27-Feb-04 22:25 
AnswerRe: globalalloc = RAM? Pin
Antti Keskinen28-Feb-04 1:23
Antti Keskinen28-Feb-04 1:23 
QuestionHow I can embed an ActiveX control in the file dialog? Pin
quantum198127-Feb-04 21:15
quantum198127-Feb-04 21:15 
GeneralCButton & CReBar Pin
Bitzer.bit27-Feb-04 21:08
Bitzer.bit27-Feb-04 21:08 
GeneralRe: CButton & CReBar Pin
Antti Keskinen28-Feb-04 1:39
Antti Keskinen28-Feb-04 1:39 
GeneralRe: CButton & CReBar Pin
Bitzer.bit28-Feb-04 2:20
Bitzer.bit28-Feb-04 2:20 
GeneralRe: CButton & CReBar Pin
Antti Keskinen29-Feb-04 2:18
Antti Keskinen29-Feb-04 2:18 
GeneralDetecting the insertion/removal of removable storage Pin
mmica27-Feb-04 20:35
mmica27-Feb-04 20:35 
GeneralRe: Detecting the insertion/removal of removable storage Pin
Antti Keskinen28-Feb-04 4:06
Antti Keskinen28-Feb-04 4:06 
GeneralRe: Detecting the insertion/removal of removable storage Pin
Michael Dunn28-Feb-04 16:23
sitebuilderMichael Dunn28-Feb-04 16:23 
QuestionHow to pass safearray in a DLL Pin
ritu_kwatra27-Feb-04 20:05
ritu_kwatra27-Feb-04 20:05 
AnswerRe: How to pass safearray in a DLL Pin
SiddharthAtw3-Mar-04 18:09
SiddharthAtw3-Mar-04 18:09 
GeneralRe: How to pass safearray in a DLL Pin
ritu_kwatra3-Mar-04 18:38
ritu_kwatra3-Mar-04 18:38 
Generalprogram won't rune in NT or XP Pin
catngo27-Feb-04 19:50
catngo27-Feb-04 19:50 
GeneralRe: program won't rune in NT or XP Pin
Gary R. Wheeler28-Feb-04 7:01
Gary R. Wheeler28-Feb-04 7:01 
GeneralRe: program won't rune in NT or XP Pin
Michael Dunn28-Feb-04 16:31
sitebuilderMichael Dunn28-Feb-04 16:31 
Questionhow to create .pdf file. Pin
Xiaodi_Liu27-Feb-04 18:52
Xiaodi_Liu27-Feb-04 18:52 
AnswerRe: how to create .pdf file. Pin
calebcohoon29-Feb-04 18:45
calebcohoon29-Feb-04 18:45 
Questioninterviewee question??? Pin
Balkrishna Talele27-Feb-04 17:25
Balkrishna Talele27-Feb-04 17:25 
AnswerRe: interviewee question??? Pin
Prakash Nadar27-Feb-04 18:34
Prakash Nadar27-Feb-04 18:34 
GeneralRe: interviewee question??? Pin
Balkrishna Talele2-Mar-04 17:34
Balkrishna Talele2-Mar-04 17:34 
GeneralRe: interviewee question??? Pin
Prakash Nadar2-Mar-04 18:14
Prakash Nadar2-Mar-04 18:14 
AnswerRe: interviewee question??? Pin
Gary R. Wheeler28-Feb-04 7:28
Gary R. Wheeler28-Feb-04 7:28 
The answer depends on the scope where the variables are defined. If the variables are defined at file scope, i.e. outside of any function definition, then their storage is global, like this:
int a=5;
int &b=a;

void Function()
{
    // ...
};
'Global' variables are constructed by the C++ runtime when program execution begins.

If the variables are defined within a function (hence they have function scope), like this:
void Function()
{
    int a=5;
    int &b=a;
    // ...
};
then they are allocated on the stack.

The fact that the variable b is a reference shouldn't alarm you. It is still an ordinary variable.


Software Zen: delete this;
GeneralRe: interviewee question??? Pin
Balkrishna Talele2-Mar-04 17:32
Balkrishna Talele2-Mar-04 17:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.