| delorie.com/archives/browse.cgi | search |
| From: | "Nicholas Parker" <NRPARKER AT XTRA DOT CO DOT NZ> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Accessing members of structures wth pointers...cntd |
| Date: | Tue, 12 Oct 1999 16:45:39 +1300 |
| Organization: | Customer of Telecom Internet Services |
| Lines: | 33 |
| Message-ID: | <7tuav8$95s9q$1@titan.xtra.co.nz> |
| NNTP-Posting-Host: | 210-55-152-146.ipnets.xtra.co.nz |
| X-Trace: | titan.xtra.co.nz 939700008 9630010 210.55.152.146 (12 Oct 1999 03:46:48 GMT) |
| X-Complaints-To: | abuse AT xtra DOT co DOT nz |
| NNTP-Posting-Date: | 12 Oct 1999 03:46:48 GMT |
| X-Priority: | 3 |
| X-MSMail-Priority: | Normal |
| X-Newsreader: | Microsoft Outlook Express 5.00.2014.211 |
| X-Mimeole: | Produced By Microsoft MimeOLE V5.00.2014.211 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Hi Again...a bit of reading later and she's right mate! I now know the '->'
operator, so another question. Here's my structure, some code
--------------------------------------------
typedef struct {
float re;
float im;
} complex;
complex nick[4];
complex *fred;
fred=&nick[0];
---------------------------------------------
I can acess a member of struct with " (*fred).re " or "fred->im"
BUT how about adding an offset;
" ( i + parker )->re " is correct, but how about in the (*point ).mem
style ???
eg;
" (*parker + i ).re " is incorrect.
and i+( * parker ).re give wrong results..Is the 'i' calculated as a float
(4 bytes ) ? not
an 8 byte 'complex' ?
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |