RE: [Dev-C++] Invalid initializer for an array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Dee Z. <zs...@br...> - 2000-10-10 11:51:19
|
On Tue, 10 Oct 2000, Ioannis Vranos wrote:
> >
> > Why do I get an "invalid initializer" message for the following
> > line in my
> > program?
> >
> > int distribution[5] = (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.
Try this int distrubution[]={0,0,0,0,0}
It means an array of ints ,with proper size (5), initialized with all
elements to 0.
zsombi
|