www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/12/20:00:39

From: Nicolas Blais <eletech AT netrover DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Problem with structs
Date: Fri, 12 Jun 1998 19:51:14 -0400
Organization: Elemental Technologies
Lines: 45
Message-ID: <3581BEF0.8790BC2F@netrover.com>
NNTP-Posting-Host: 198.168.87.4
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi, everytime I run my header file (a bit which is copied below), I get
error 76 (Invalid Initializer) at line char caption[20] =
button[callsign].caption[20];

Should copying a Char[20] into a Char[20] work?
Thanks, Nicolas Blais.

struct Button_Properties
       {
       int x;
       int y;
       int width;
       int height;
       char caption[20];
       int forecolor;
       int dimen3d;
       } button[MAX_BUTS];


void create_button(int callsign,int leftx,int topy,int width,int
height,char caption[20],int color,int TREED)
     {
     button[callsign].x = leftx;
     button[callsign].y = topy;
     button[callsign].width = width;
     button[callsign].height = height;
     button[callsign].caption[20] = caption[20];
     button[callsign].forecolor = color;
     button[callsign].dimen3d = TREED;
     /*Bla Bla Bla*/
     }

void button_down(int callsign)
     {
     int leftx = button[callsign].x;
     int topy = button[callsign].y;
     int width = button[callsign].width;
     int height = button[callsign].height;
     char caption[20] = button[callsign].caption[20];      //Error 76
here.
     int color = button[callsign].forecolor;
     int TREED = button[callsign].dimen3d;
     /*Bla Bla Bla*/
    }

- Raw text -


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