delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/26/12:17:47

From: joshuahab AT aol DOT com (Joshua Hab)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: structures and structure pointers
Date: 23 Oct 1997 22:15:59 GMT
Lines: 15
Message-ID: <19971023221501.SAA24872@ladder02.news.aol.com>
NNTP-Posting-Host: ladder02.news.aol.com
Organization: AOL http://www.aol.com
References: <344F7736 DOT 13283EEC AT alcyone DOT com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>   struct S { int x, y, z; };
>
>    S s = { 1, 2, 3 };
>
>    int x = s.x;
>
>    S *sp = &s;
>
>    int y = s->y;

One question, wouldn't that last one be:

int y = sp->y;   

since s is the actual structure variable, and sp is the pointer?

- Raw text -


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