extern
- From: DevarajA <no@xxxxxxxx>
- Date: Tue, 19 Jul 2005 13:13:33 GMT
Can anyone explain me what extern is used for? I thought it was used to declare variables definited in other files, but i can do that also without extern.
/*file a.c*/
int a=5;
int main()
{
f();
}/*file b.c*/
int a;
void f()
{
printf("%d\n",a); /*it prints 5*/
}Another thing, what happens if i declare a function like this: extern int fn(void) ?
-- Devaraja (Xdevaraja87^gmail^c0mX) Linux Registerd User #338167 http://counter.li.org .
- Follow-Ups:
- Re: extern
- From: Mark McIntyre
- Re: extern
- From: Me
- Re: extern
- From: Jack Klein
- Re: extern
- From: ade ishs
- Re: extern
- Prev by Date: Re: is *ptr++ equivalent to *(ptr++)
- Next by Date: Re: meaning of the error ?
- Previous by thread: Loop termination question. I hope this is the right forum
- Next by thread: Re: extern
- Index(es):
Relevant Pages
|