delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/23/15:33:41

Sender: nate AT cartsys DOT com
Message-ID: <368151D9.7AFACDB2@cartsys.com>
Date: Wed, 23 Dec 1998 12:26:01 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: 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>
Reply-To: djgpp AT delorie DOT com

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...

The `.' operator binds more tightly than `*'.  Thus, you would say

(*structs[i]).member

or better,

structs[i]->member

This would have been more properly posted to comp.lang.c.  Also consider
getting a book on C.
 
> 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?

What problems did you encounter?
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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