Click here to Skip to main content
15,891,621 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How detect leak memory Pin
Le Thanh Cong17-Apr-06 21:12
Le Thanh Cong17-Apr-06 21:12 
Questionchange program icon in VS2005 Pin
big_denny_20016-Apr-06 23:02
big_denny_20016-Apr-06 23:02 
AnswerRe: change program icon in VS2005 Pin
YaronNir17-Apr-06 4:45
YaronNir17-Apr-06 4:45 
AnswerRe: change program icon in VS2005 Pin
Hamid_RT17-Apr-06 19:35
Hamid_RT17-Apr-06 19:35 
QuestionGlobal static variables Pin
vikramlinux16-Apr-06 22:46
vikramlinux16-Apr-06 22:46 
AnswerRe: Global static variables Pin
sunit516-Apr-06 23:02
sunit516-Apr-06 23:02 
GeneralRe: Global static variables Pin
vikramlinux16-Apr-06 23:13
vikramlinux16-Apr-06 23:13 
GeneralRe: Global static variables Pin
vikramlinux17-Apr-06 0:37
vikramlinux17-Apr-06 0:37 
Hi Friends,
After some analysis I got following answers
1) When u compile your files(any type of project). each cpp/cxx/C file treated as separate translation unit
2) Object file will be created for each one of them

So for static variables

1) If the static variable in declared in some other cpp/cxx/c file, U can not access it ( using extern keyword) as it becomes as private for that file/translation unit.
2) If u declared global static variable in header file then each translation unit will get copy of it and also your final exe will contain mutiple instances of that global variable
for each file contents (means the functions/classes... inside file ).

Experts.. Please correct me if there is any incorrectness.

VikramS
GeneralRe: Global static variables Pin
vikramlinux17-Apr-06 0:38
vikramlinux17-Apr-06 0:38 
QuestionTiming diagram Pin
RockyJames16-Apr-06 22:40
RockyJames16-Apr-06 22:40 
AnswerRe: Timing diagram Pin
David Crow17-Apr-06 3:38
David Crow17-Apr-06 3:38 
QuestionConvert STL string --> TCHAR (clairification) Pin
chasetoys16-Apr-06 21:09
chasetoys16-Apr-06 21:09 
AnswerRe: Convert STL string --> TCHAR (clairification) Pin
Hallery.Lai16-Apr-06 22:08
Hallery.Lai16-Apr-06 22:08 
GeneralRe: Convert STL string --> TCHAR (clairification) Pin
chasetoys16-Apr-06 22:18
chasetoys16-Apr-06 22:18 
GeneralRe: Convert STL string --> TCHAR (clairification) Pin
Hallery.Lai16-Apr-06 22:49
Hallery.Lai16-Apr-06 22:49 
GeneralRe: Convert STL string --> TCHAR (clairification) Pin
chasetoys16-Apr-06 23:38
chasetoys16-Apr-06 23:38 
AnswerRe: Convert STL string --> TCHAR (clairification) Pin
Michael Dunn17-Apr-06 8:09
sitebuilderMichael Dunn17-Apr-06 8:09 
QuestionAbout draw a picture in dialog box Pin
lisoft16-Apr-06 21:00
lisoft16-Apr-06 21:00 
AnswerRe: About draw a picture in dialog box Pin
Le Thanh Cong16-Apr-06 22:59
Le Thanh Cong16-Apr-06 22:59 
AnswerRe: About draw a picture in dialog box Pin
Nishad S16-Apr-06 23:27
Nishad S16-Apr-06 23:27 
GeneralRe: About draw a picture in dialog box Pin
lisoft17-Apr-06 17:34
lisoft17-Apr-06 17:34 
QuestionTAPI , COM Pin
asdf175316-Apr-06 20:57
asdf175316-Apr-06 20:57 
AnswerRe: TAPI , COM Pin
YaronNir16-Apr-06 21:39
YaronNir16-Apr-06 21:39 
GeneralRe: TAPI , COM Pin
asdf175316-Apr-06 23:07
asdf175316-Apr-06 23:07 
GeneralRe: TAPI , COM Pin
YaronNir17-Apr-06 0:31
YaronNir17-Apr-06 0:31 

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.