Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | James Kuyper <jameskuyper@verizon.net> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Changing type at runtime for image acquisition |
| Date | 2011-11-21 15:42 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <4ECAB7CC.3020505@verizon.net> (permalink) |
| References | <KMxyq.101324$GZ3.69880@tornado.fastwebnet.it> <4ECAAE78.7050304@verizon.net> <nzyyq.101345$GZ3.64187@tornado.fastwebnet.it> |
On 11/21/2011 03:32 PM, Davide wrote:
> James Kuyper wrote:
>
> <snip>
>> You could use void* to store the pointer to the buffer, and convert to
^^^^^
>> __int8 or __int16 as needed:
>>
>> if(eight_bit)
>> n = ((__int8*)internal_buffer)[j];
>> else
>> n = ((__int16*)internal_buffer)[j];
>>
>> In some ways, that would be the cleanest approach. However, if that
>> would require you to doing too many explicit conversions, then it might
>> be easier to use a union:
...
> but i have some doubts about the first one. What type should 'n' be?
void*
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Changing type at runtime for image acquisition Davide <idontwant@emailsfrom.spammers> - 2011-11-21 20:38 +0100
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 15:03 -0500
Re: Changing type at runtime for image acquisition Davide <idontwant@emailsfrom.spammers> - 2011-11-21 21:32 +0100
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 15:42 -0500
Re: Changing type at runtime for image acquisition James Kuyper <jameskuyper@verizon.net> - 2011-11-21 16:04 -0500
Re: Changing type at runtime for image acquisition Kaz Kylheku <kaz@kylheku.com> - 2011-11-21 20:48 +0000
Re: Changing type at runtime for image acquisition "BartC" <bc@freeuk.com> - 2011-11-21 21:34 +0000
csiph-web