470,833 Members | 1,375 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

array declaration

new
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?

Please help.

Thank you.
Jun 27 '08 #1
1 1358
new <lu******@gmail.comwrites:
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) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by songkv | last post: by
5 posts views Thread by pandapower | last post: by
8 posts views Thread by intrepid_dw | last post: by
19 posts views Thread by DarelRex | last post: by
17 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
18 posts views Thread by mdh | last post: by
26 posts views Thread by aruna.mysore | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.