www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/11/18:30:36

From: Endlisnis <s257m AT unb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: pointers and errors make cephaler go crazy
Date: Tue, 11 Aug 1998 18:39:35 -0300
Organization: NBTel Internet
Lines: 36
Message-ID: <35D0BA17.21A5DC36@unb.ca>
References: <01bdc535$858a16c0$0100007f AT scully>
NNTP-Posting-Host: fctnts06c82.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Cephaler wrote:

> blit(tiles[map[x][y]->tile],screen,0,0,x*32,y*32,32,32)

> typedef struct {
>   unsigned char tile,tag;
> } _tile;
>
> _tile *map[100][100];
>
> for(a=0;a<100;a++) {
>   for(b=0;b<100;b++) {
>     if((map[a][b]=(_tile *)malloc(sizeof(_tile)))==NULL) {blah}
>   }
> }

Why not just make it:_tile map[100][100];
then the top line of code would be:
blit(tiles[map[x][y].tile],screen,0,0,x*32,y*32,32,32)
What was the error that the compiler gave you on this line of code (without the
'&').  And what is 'blit' & 'tiles'.

> p.s. subject is simpsons quote (no tv and no beer make homer go crazy..
> halloween episode)

    Yes, I knew that.  Urge to kill growing.

--
     (\/) Endlisnis (\/)
          s257m AT unb DOT ca
          Endlisnis AT GeoCities DOT com
          Endlis AT nbnet DOT nb DOT ca




- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019