delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/07/08:08:53

Date: Sat, 7 Jun 1997 13:07:16 +0100 (BST)
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
Message-Id: <199706071207.NAA29942@sable.ox.ac.uk>
To: myork AT auracom DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: yet ANOTHER allegro question... EASY
Organization: Oxford University, England

SteelGolem (myork AT auracom DOT com) wrote:

: it gives me an error:

: alleg2.c: In function 'main':
: alleg2.c:13: request for member 'w' in something not a structure or
: union
...
:   BITMAP *bmp;
...
:   printf( "width of bmp is %d\n", *bmp.w );

The compiler is reading this as *(bmp.w), and bmp is a pointer not a
struct. What you should write is either (*bmp).w or the clearer bmp->w,
which have the same effect.

-- 
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford

- Raw text -


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