Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bitmap Stuff Pin
Mark Donkers11-Dec-01 11:29
Mark Donkers11-Dec-01 11:29 
GeneralReally Basic Data Type Questions Pin
Stu Pedful11-Dec-01 8:23
Stu Pedful11-Dec-01 8:23 
GeneralRe: Really Basic Data Type Questions Pin
Chris Losinger11-Dec-01 8:41
professionalChris Losinger11-Dec-01 8:41 
GeneralRe: Really Basic Data Type Questions Pin
Stu Pedful11-Dec-01 9:36
Stu Pedful11-Dec-01 9:36 
GeneralRe: Really Basic Data Type Questions Pin
moliate11-Dec-01 21:13
moliate11-Dec-01 21:13 
GeneralThanks! Pin
Stu Pedful12-Dec-01 2:26
Stu Pedful12-Dec-01 2:26 
GeneralRe: Really Basic Data Type Questions Pin
Alvaro Mendez12-Dec-01 8:48
Alvaro Mendez12-Dec-01 8:48 
GeneralExtern Question Pin
Stu Pedful14-Dec-01 15:19
Stu Pedful14-Dec-01 15:19 
Thanks for the reply. I would like you to clarify a couple of points though.

Alvaro Mendez wrote:

extern int nTest; extern void foo();

In that case, the linker uses the ones defined globally in A.cpp.

To finish my point, by making the variable and function "static", the linker ties them to the files themselves and does not treat them as globals.


If all variables and functions that are not declared as "static" are automatically treated as global, then what is the purpose of "extern"? I was under the impression that extern was necessary for the value of a variable or function to persist across multiple source files. Is this true or no? And, how and when is "extern" used? If I wanted a variable or function to persist across multiple source files, would I just declare and define it in one of the source files and then put "extern <datatype> <variable name="">" in one of the common header files included at the top of each source files? Or is "extern" unnecessary in that case?
GeneralRe: Extern Question Pin
Alvaro Mendez16-Dec-01 11:36
Alvaro Mendez16-Dec-01 11:36 
GeneralMMC applications Pin
rk200011-Dec-01 8:04
rk200011-Dec-01 8:04 
GeneralRe: MMC applications Pin
Michael Dunn11-Dec-01 8:20
sitebuilderMichael Dunn11-Dec-01 8:20 
GeneralHelp :D Pin
RobJones11-Dec-01 6:55
RobJones11-Dec-01 6:55 
GeneralRe: Help :D Pin
Carlos Antollini11-Dec-01 7:11
Carlos Antollini11-Dec-01 7:11 
QuestionHow to delete a character in CRichEditView? Pin
davilism11-Dec-01 6:42
davilism11-Dec-01 6:42 
AnswerRe: How to delete a character in CRichEditView? Pin
Carlos Antollini11-Dec-01 7:17
Carlos Antollini11-Dec-01 7:17 
GeneralRe: How to delete a character in CRichEditView? Pin
davilism12-Dec-01 6:21
davilism12-Dec-01 6:21 
GeneralChanging dialog size Pin
Chris Losinger11-Dec-01 6:32
professionalChris Losinger11-Dec-01 6:32 
GeneralRe: Changing dialog size Pin
Carlos Antollini11-Dec-01 6:49
Carlos Antollini11-Dec-01 6:49 
GeneralRe: Changing dialog size Pin
Chris Losinger11-Dec-01 7:43
professionalChris Losinger11-Dec-01 7:43 
GeneralRe: Changing dialog size Pin
Carlos Antollini11-Dec-01 8:29
Carlos Antollini11-Dec-01 8:29 
GeneralRe: Changing dialog size Pin
Chris Losinger11-Dec-01 8:32
professionalChris Losinger11-Dec-01 8:32 
QuestionChanging the size of the window? Pin
Chambers11-Dec-01 5:56
Chambers11-Dec-01 5:56 
AnswerRe: Changing the size of the window? Pin
NormDroid11-Dec-01 6:05
professionalNormDroid11-Dec-01 6:05 
GeneralRe: Changing the size of the window? Pin
Chambers12-Dec-01 1:31
Chambers12-Dec-01 1:31 
GenerallistCtrl question Pin
Djibril11-Dec-01 5:54
professionalDjibril11-Dec-01 5:54 

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.