delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/18/20:12:07

From: "Andy Kilner" <andy AT kilner DOT karoo DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: array subscript error
Date: Thu, 18 Mar 1999 19:57:28 -0000
Organization: Customer of Planet Online
Lines: 33
Message-ID: <7crlk8$57p$1@newsreader3.core.theplanet.net>
NNTP-Posting-Host: modem105.scully.kingston-internet.net
X-Trace: newsreader3.core.theplanet.net 921786824 5369 195.92.234.233 (18 Mar 1999 19:53:44 GMT)
NNTP-Posting-Date: 18 Mar 1999 19:53:44 GMT
X-Complaints-To: abuse AT theplanet DOT net
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
Reply-To: djgpp AT delorie DOT com

Can somebody please tell me why I get this compilation error and how if
possible to solve it.

here's the error:
Error: invalid types 'screen_ch[char]' for array subscript

here's the code:

struct screen_attr{
  unsigned char foreground :4,
                   background :4;
};

struct screen_ch{
  unsigned char ch;
  screen_attr attr;
};

screen_ch* buffer = new screen_ch [ window.Area() ];
char curx, cury;

char getChar()
{
  return buffer[cury][curx]->ch;
}


I probably over complicated the info I've given but I'm just trying to make
sure everything's there.
Cheers
Andy


- Raw text -


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