RE: [Dev-C++] Invalid initializer for an array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2000-10-10 10:56:11
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...]On Behalf Of
> Richard P. Evans
> Sent: Tuesday, October 10, 2000 5:08 AM
> To: dev...@li...
> Subject: [Dev-C++] Invalid initializer for an array
>
>
> Why do I get an "invalid initializer" message for the following
> line in my
> program?
>
> int distribution[5] = (0);
>
int distribution[5]={0,0,0,0,0};
> It seems the only thing that works to initialize an array is a "for"
> statement. Does anyone have an answer? The above line is by the
> book and
> should work. Or is this a software bug? Some how I doubt that.
I am new at C++, but i think that your initialisation is somehow wrong.
Ioannis
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
|