Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Question Date: Thu, 28 Jul 2016 11:58:33 -0700 Organization: None to speak of Lines: 51 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="2912"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/J1qfbCLosCS72ugYTYKVC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:mPYstloVno9qC3exS5Q9vjVSu4A= sha1:K+tE6DId62i2Q12q72sQSma/IXU= Xref: csiph.com comp.lang.c:91266 BartC 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 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"