Mail Archives: djgpp/1998/07/06/20:27:38
Oliver Batchelor wrote:
>
> Could anyone tell me what the type is for a byte.
>
> BYTE, byte, Byte, b, B none of these seem to work, BYTE used to work for
> me in turbo c. What is it !! Very frustrating !!
`unsigned char' is a byte. Anything like BYTE was a non-portable Turbo
C extension.
> Also I have an array called (would be bytes but I cant find how to
> declare them !)
>
> Int map[100][100]
> BITMAP *img[50]
>
> Now I want to zero the whole array or assign the whole array to something
> like 10
>
> for(x=0;x<100;x++) {
> for(y=0;y<100;y++) {
> Map[x,y]=0;
> }}
> It tells me that this is an incompatible assignment !
It is. To index into a 2D array in C, you need to do `Map[x][y]'. What
you have is the comma operator, which evaluates the first operand and
returns the second.
> and later when I go to draw the sprites on the screen I have
>
> blit(img[map[x,y]], active_page, .......continues...
>
> It tells me that array subscript is non integer.
Also true. See above.
> (Im sure this worked in turbo C, both things)
Then Turbo C is wrong; or it's a very strange extension.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -