delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/23/13:22:16

Message-ID: <368134C0.43B483D3@lycosmail.com>
Date: Wed, 23 Dec 1998 13:21:53 -0500
From: Adam Schrotenboer <ajschrotenboer AT lycosmail DOT com>
X-Mailer: Mozilla 4.5 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Toni Rasanen <torasane AT mail DOT student DOT oulu DOT fi>
CC: djgpp AT delorie DOT com
Subject: Re: Structs in pointers and something of BINUTILS
References: <Pine DOT SGI DOT 3 DOT 95 DOT 981223132631 DOT 9473A-100000 AT paju DOT oulu DOT fi>
X-MIME-Autoconverted: from 8bit to quoted-printable by oak.oakland.edu id NAA10086
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id NAA17536
Reply-To: djgpp AT delorie DOT com

for one thing, rewrite that as
structtype structs[100].

Second, do you want to be able to use the pointer for something???????
If so, declare it normally, and use an ampersand "&" before it, which
means you get a pointer to where the data is located. I don't think that
you wanted to declare it as a pointer array, nor a pointer to the array.
Probably you should declare a pointer variable with typeof[member], and
assign the &structs[i].member to the pointer variable.

Hope this helps.

Toni Rasanen wrote:

> Oh, C fundamentals...
>
> I have a struct defined. It worked fine while I kept in in data;
> struct structtype structs[100];
> However, when I modified them to be pointers, compiler no longer
> finds members of structure;
> struct structtype *structs[100];
> ...
> *structs[i].member = ...
>
> What's the proper way to access that struct? I have tried everything
> I can think of, but without any success...
>
> Also, I tried to recompile binutils' OBJCOPY, but without success.
> It seems that I need something else too to compile (or even configure)
> it, in addition of normal djgpp binaries. WHAT do I need?
>
>  ///           Toni Räsänen
> ///       torasane AT mail DOT student DOT oulu DOT fi
> \\\  Physicians ask how. Filosofians ask why. Dragons don't care.

- Raw text -


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