By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

char a[0] ;

P: n/a
What is the

char a[0] ;

declaration? What does it mean? How does it work? What is it for?
Mar 13 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Harold Weissman wrote:
What is the

char a[0] ;

declaration? What does it mean? How does it work? What is it for?
Please consult your prescribed textbook.

Mar 13 '07 #2

P: n/a
Harold Weissman <Ha*******@hotmail.comwrites:
What is the

char a[0] ;

declaration? What does it mean? How does it work? What is it for?
It's a constraint violation, because the constant expression
inside the brackets does not have a value greater than zero.

Perhaps you are looking for the "struct hack". In that case,
take a look at the FAQ, question 2.6.
--
"If I've told you once, I've told you LLONG_MAX times not to
exaggerate."
--Jack Klein
Mar 13 '07 #3

P: n/a
On Mar 14, 3:55 am, "santosh" <santosh....@gmail.comwrote:
Harold Weissman wrote:
What is the
char a[0] ;
declaration? What does it mean? How does it work? What is it for?

Please consult your prescribed textbook.
Prescribed textbooks may well not mention this, since it is not
standard C. It doesn't seem to be mentioned in the FAQ either
(the struct hack section only covers char a[1]).

Mar 13 '07 #4

P: n/a

Old Wolf wrote:
On Mar 14, 3:55 am, "santosh" <santosh....@gmail.comwrote:
Harold Weissman wrote:
What is the
char a[0] ;
declaration? What does it mean? How does it work? What is it for?
Please consult your prescribed textbook.

Prescribed textbooks may well not mention this, since it is not
standard C. It doesn't seem to be mentioned in the FAQ either
(the struct hack section only covers char a[1]).
That was my point. If he read his textbook, he'd have known that the
above definition is invalid.

Mar 14 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.