Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Keith Thompson <kst-u@mib.org> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Question |
| Date | 2016-07-28 11:58 -0700 |
| Organization | None to speak of |
| Message-ID | <ln7fc58u92.fsf@kst-u.example.com> (permalink) |
| References | <nnd8ue$nnp$2@dont-email.me> <nndd2r$7lg$1@dont-email.me> |
BartC <bc@freeuk.com> writes:
> On 28/07/2016 16:38, DFS wrote:
>> Take a C structure:
>>
>> struct imageType {
>> imageOpsType *ops;
>> coordType width;
>> coordType height;
>> int32_t depth; /* 1..32 */
>> int32_t linebytes; /* bytes per line */
>> int32_t allocated; /* bytes allocated */
>> int64_t fill; /* color to fill with */
>> int8_t sign;
>> imageType *primary; /* for secondary, assoc primary */
>> coordType primaryX; /* for secondary, offset in primary */
>> coordType primaryY; /* for secondary, offset in primary */
>> int8_t *data;
>> uint32_t flags; /* image access mode(s) */
>> int32_t verbose;
>> int32_t page; /* number of the current page */
>> double resX; /* pixels per unit in X */
>> double resY; /* pixels per unit in Y */
>> int32_t resUnit; /* 0=nores 1=unk 2=inch 3=cm */
>> char modes[MAX_MODES]; /* modes used with open */
>> char name[MAX_NAME];
>> int64_t clientData[CLIENT_SIZE]; };
>>
>>
>> What does the following statement accomplish, given that
>> "image" and "src" are both pointers to imageType?
>>
>> (*(imageType**)&(image)->clientData[0])=(src)
>
> It depends on whether the & applies to just (image) or to the -> part
> too (I don't know off-hand).
You could easily find out before posting.
[...]
> (Note than imageType is a struct tag name rather than a type name, so I
> guess this is not the exact code.)
Perhaps -- or perhaps the code was compiled as C++, and the OP
mistakenly assumed it was C.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Question DFS <nospam@dfs.com> - 2016-07-28 11:38 -0400
Re: Question Melzzzzz <mel@zzzzz.com> - 2016-07-28 17:50 +0200
Re: Question BartC <bc@freeuk.com> - 2016-07-28 17:49 +0100
Re: Question Melzzzzz <mel@zzzzz.com> - 2016-07-28 18:52 +0200
Re: Question Keith Thompson <kst-u@mib.org> - 2016-07-28 11:58 -0700
Re: Question BartC <bc@freeuk.com> - 2016-07-28 20:57 +0100
Re: Question "D. Aaron Sawyer" <aaron@110.net> - 2016-07-28 13:55 -0300
Re: Question Barry Schwarz <schwarzb@dqel.com> - 2016-07-28 11:38 -0700
Re: Question DFS <nospam@dfs.com> - 2016-07-28 15:20 -0400
Re: Question Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-30 09:24 -0700
Re: Question Ian Collins <ian-news@hotmail.com> - 2016-07-29 07:23 +1200
Re: Question James Kuyper <jameskuyper@verizon.net> - 2016-07-28 16:05 -0400
Re: Question DFS <nospam@dfs.com> - 2016-07-29 10:14 -0400
Re: Question "James R. Kuyper" <jameskuyper@verizon.net> - 2016-07-30 14:45 -0400
Re: Question supercat@casperkitty.com - 2016-08-01 05:19 -0700
Re: Question Tim Rentsch <txr@alumni.caltech.edu> - 2016-07-30 09:17 -0700
csiph-web