Talk About Network

Google


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 > extern declarat...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 25290 of 27670
Post > Topic >>

extern declaration

by Rahul <sam_cit@[EMAIL PROTECTED] > Apr 2, 2008 at 06:35 AM

Hi Everyone,

 I wanted to know if the following declaration is valid?

extern int i = 10;

#include <cstdio>

int main()
{
 printf("%d\n",i);
}

I get the following warning,

warning: `i' initialized and declared `extern'

I expected an error, as extern by itself indicates that the variable
is defined in some other compilation unit...
 




 8 Posts in Topic:
extern declaration
Rahul <sam_cit@[EMAIL   2008-04-02 06:35:41 
Re: extern declaration
Richard Heathfield <rj  2008-04-02 13:53:25 
Re: extern declaration
"Magic.Yang" &l  2008-04-02 07:36:09 
Re: extern declaration
Richard Heathfield <rj  2008-04-02 14:43:09 
Re: extern declaration
Kenneth Brody <kenbrod  2008-04-02 12:12:19 
Re: extern declaration
Andrey Tarasevich <and  2008-04-02 23:17:22 
Re: extern declaration
Andrey Tarasevich <and  2008-04-02 23:15:39 
Re: extern declaration
Joe Wright <joewwright  2008-04-04 18:30:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Oct 10 21:54:56 CDT 2008.