delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/01/23:12:16

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Type casting problems with gcc
Date: Sat, 01 Mar 1997 22:09:20 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 22
Message-ID: <33191990.5073@cs.com>
References: <5f9trv$e6t AT crl9 DOT crl DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp206.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Samuel McGrath wrote:
> 
> I'm using the Allegro graphics library right now, and I'm trying to
> reference the w and h fields of the BITMAP structure like this:
> 
> void* bmp = create_bitmap(320,200);
> int bitmapwidth = (BITMAP*)(bmp)->w;

Try:  int bitmapwidth = ((BITMAP *) bmp)->w;

I'm at a loss for why you can't just declare it the proper type to begin
with, though...  if you post the code that includes such a construct I'd
be glad to try to show you a better way to achieve what you're trying to
do.  :)


-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |        fighteer AT cs DOT com          |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


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