Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Globals and Exp...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 14 Topic 26067 of 26188
Post > Topic >>

Globals and Exports

by "Bartc" <bc@[EMAIL PROTECTED] > May 5, 2008 at 09:53 AM

I noticed that in C, functions in any module are automatically exported. So

that it's not possible to use the same function name in two modules (ie. 
source files).

Now that I know that, I get work around it; but is there a way to avoid
the 
problem (short of lots of renaming)?

More seriously, variables declared at file scope also seem to be 
automatically exported. But in this case, the compiler/linker doesn't warn

me that the same name is being used in two or more modules. (Is this what 
the fuss is about with 'global variables'?)

Is there any way I can fix this? (Like some keyword that will render a 
variable local to a module.)

-- Bartc




 14 Posts in Topic:
Globals and Exports
"Bartc" <bc@  2008-05-05 09:53:12 
Re: Globals and Exports
Antoninus Twink <nospa  2008-05-05 12:12:43 
Re: Globals and Exports
"Bartc" <bc@  2008-05-05 11:00:02 
Re: Globals and Exports
Flash Gordon <spam@[EM  2008-05-05 12:12:28 
Re: Globals and Exports
Flash Gordon <spam@[EM  2008-05-05 11:40:48 
Re: Globals and Exports
Mark McIntyre <markmci  2008-05-05 12:18:00 
Re: Globals and Exports
Antoninus Twink <nospa  2008-05-05 15:00:02 
Re: Globals and Exports
Flash Gordon <spam@[EM  2008-05-05 14:16:25 
Re: Globals and Exports
"Malcolm McLean"  2008-05-05 21:40:52 
Re: Globals and Exports
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 09:55:27 
Re: Globals and Exports
=?ISO-8859-1?Q?Tom=E1s_=D  2008-05-05 10:02:48 
Re: Globals and Exports
Martin Ambuhl <mambuhl  2008-05-05 15:06:55 
Re: Globals and Exports
John Bode <john_bode@[  2008-05-05 16:07:30 
Re: Globals and Exports
Nick Keighley <nick_ke  2008-05-06 03:17:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 19:30:23 CDT 2008.