Mail Archives: djgpp/1997/05/16/14:20:38
Gautam N. Lad wrote:
> My Ship array holds numbers, which are 40x25, another words, 1000
> numbers.
> I can write up the numbers one by one, but since I already have the
> numbers in
> separate files, I just want to combine it as one.
> I have 24 files with the numbers. Get it now!?!
What you're trying to do is so foreign to C that the previous poster
didn't even understand what you were asking, I suspect.
As I said in a previous post, you're trying to assign the elements of the
two-dimensional array a row at a time (what you're calling a "file," which
has a different meaning in C), and this is not legal. The only time, in
fact, the curly-brace assignment is legal is at initialization -- i.e., on
the same statement where you declare the array. And in that case, you
must initialize the _entire_ array, not just a row.
> I never bothered to touch up on 2D arrays (of anything other than
> chars). I had
> the following in mind:
>
> BYTE Ship[24][1000] = {
> {0,0,0,...},
> {0,0,0,...},
> {0,0,0,...}.....
> {0,0,0,...}};
>
> But I didn't try. I now think this is it.
This will work.
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"The future / is right there."
/ Bill Moyers
- Raw text -