www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/06/22:05:47

Message-Id: <3.0.5.16.19980906220313.0cf77836@mail.tir.com>
Date: Sun, 06 Sep 1998 22:03:13 -0400
To: djgpp AT delorie DOT com
From: "Thomas J. Hruska" <thruska AT tir DOT com>
Subject: struct...help?
Mime-Version: 1.0

I was looking at RHIDE and DJGPP doesn't seem to support the struct
keyword.  Struct is an ANSI standard and is required pretty much for all
compilers to have the feature.

Second, I am having a problem with the following lines of code under
Borland Turbo C:

struct extDate {
	unsigned char Month;
	unsigned char Day;
	unsigned int Year;
	long int Number;
} IssueDate;

void FunctionName(void)
{
	struct extDate TempDate;
<code>
	TempDate = {12, 23, 1993, 0};
}

The compiler gives me an error about the expression syntax.  What is going
on?  I don't have much documentation on structure initialization.  I want
to initialize the entire structure in one line.  I know I can do:

void FunctionName(void)
{
	struct extDate TempDate = {12, 23, 1993, 0};
}

However, I believe the date changes in the spreadsheet someplace and I
would need to change the code like in the first example anyway.


                 Thomas J. Hruska -- thruska AT tir DOT com
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://shinelight.home.ml.org

- Raw text -


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