delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/06/10:46:51

From: Timo Asikainen <thka AT lyseo DOT edu DOT ouka DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro and dynamic pointer arrays for BITMAP structs
Date: Mon, 06 Jul 1998 17:32:35 -0700
Organization: Oulu Polytechnic, Institute of Technology, Finland
Lines: 16
Message-ID: <35A16CA2.5903@lyseo.edu.ouka.fi>
Reply-To: thka AT lyseo DOT edu DOT ouka DOT fi
NNTP-Posting-Host: anne100.wnet.opoy.fi
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm using allegro 3.0 and I'm having some problems doing dynamic 
pointer arrays for BITMAP structs (something like BITMAP *sprite[10])

how can I allocate memory with for example malloc or calloc for
BITMAP pointer arrays. I've tried it like this:

BITMAP **sprite;

sprite=(BITMAP**)malloc(num_sprite*sizeof(BITMAP));

sometimes it works. Sometimes it doesn't. I don't even know whether
I'm allocating the memory correctly. If somebody knows how to do this 
please tell me too.

----
Timo Asikainen

- Raw text -


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