Arrays and stuff
Brian K. W. Hook
jdb at reef.cis.ufl.edu
Fri Feb 15 01:31:24 AEST 1991
I just searched the FAQ for this one, but basically just look at the
example and see if you know of a way around this:
Basically, you can initialize an array with values, and you can't
re-initialize after declaration. However, if I wanted to put a string into
an array I could use strcpy(), but I want to fill in the entire array with
a predefined array: in effect:
char array[NUMBER][SIZE];
array[number]={ ...assorted values...};
How do I do this? I want different bitmasks for a cursor depending on what
the user does, but I can't seem to implement this very easily unless
I use:
char *mask;
mask=&array[0][0];
or
strcpy(mask,array[0]);
But this is a pain for certain things that I am doing. And I DEFINITELY
don't want to do:
array[0][0]=0x44;
array[0][1]=0x99;
etc. etc.
This is the way I do it right now since it offers some flexibility....but
it is SOOOOOOO ugly.
Brian
More information about the Comp.lang.c
mailing list