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 > Re: array decla...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 26066 of 26955
Post > Topic >>

Re: array declaration

by Keith Thompson <kst-u@[EMAIL PROTECTED] > May 5, 2008 at 01:27 AM

new <luvraghu@[EMAIL PROTECTED]
> writes:
> struct abc
> {
> int x;
> char y;
> };
>
> struct xyz
> {
> struct abc p[0];  //LINE 1
> int q;
> };
>
> int a[0];    //LINE 2
>
> Are the declarations in line 1 and line 2 correct?

No.  An array must have at least one element.

Incidentally, you should always indent your code to reflect its
structure.

-- 
Keith Thompson (The_Other_Keith) <kst-u@[EMAIL PROTECTED]
>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
 




 2 Posts in Topic:
array declaration
new <luvraghu@[EMAIL P  2008-05-05 00:25:39 
Re: array declaration
Keith Thompson <kst-u@  2008-05-05 01:27:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Thu Jul 24 2:28:13 CDT 2008.