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

C / C++ / MFC

 
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 
GeneralRe: Extern Question Pin
Alvaro Mendez16-Dec-01 11:36
Alvaro Mendez16-Dec-01 11:36 
Remember that everything in C must be declared. If you want to use a variable defined in another file, you need to declare it in yours as extern. That's what extern is for: to tell the current file that you're using a variable defined somewhere else. If you don't use the extern keyword, the compiler thinks that you're defining it in that file.

Note that the extern keyword is only necessary for global variables. Functions don't really need it since the compiler can tell that you're not defining them by the fact it's a prototype with no body.

So, to sum it up, the extern keyword is necessary for a variable (not just its value) to be made visible across multile files.

Regards,
Alvaro
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 
GeneralRe: listCtrl question Pin
Prem Kumar11-Dec-01 6:27
Prem Kumar11-Dec-01 6:27 

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.