delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/29/21:07:03

From: "=?iso-8859-1?Q?stefan_fr=F6berg?=" <traveler AT netti DOT fi>
Newsgroups: comp.os.msdos.djgpp
Subject: STRUCTURE WITH CHANGING ARRAY AS A MEMBER
Date: Tue, 30 Nov 1999 02:55:36 +0200
Organization: SAUNALAHDEN SERVERIN asiakas
Lines: 39
Message-ID: <81v6u4$86p$1@tron.sci.fi>
NNTP-Posting-Host: mmdcl.hdyn.saunalahti.fi
Mime-Version: 1.0
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id UAB05853
Reply-To: djgpp AT delorie DOT com

Hi !

Is it possible to define a structure that uses arrays that are not indexed ?
Are there any tricks how to "teach" the compiler to somehow calculate the 
number of indexes needed 
(something like the stuff done for char arrays like:
/*char pointer table with each member indexed up to NULL character*/
 char *string[] = {"Dog",   
                        "Cat",
                        "Chicken"};) 
when the structure variable is initialized ?


typedef    struct
{
    int    array[];            
} STUFF;

int    main(void)
{
    STUFF    morestuff = {1,12,3,56};    // Does not work. How can you "teach"
                                                            // the compiler to calculate the array indexes
}

Also, how do you put that damn pixel on the screen on EGA (12h, 640x480x16)
mode. (Yeah, I know that there are bitplanes or something like that but
a code example would help me more...)

"Hou, hou ,hou..."
stefan fröberg
traveler AT netti DOT fi



- Raw text -


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