RE: [Dev-C++] Invalid initializer for an array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: <Jam...@gm...> - 2000-10-10 22:37:13
|
It works fine if you use {} instead of () Try this: int distribution[5] = {0}; You´ll get no error message. RT > -----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); > > 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. > > Richard Evans > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/mailman/listinfo/dev-cpp-users > |