Re: How to access the value that a pointer is pointing to
Re: How to access the value that a pointer is pointing to
- Subject: Re: How to access the value that a pointer is pointing to
- From: Patrick Seemann <email@hidden>
- Date: Sat, 29 Apr 2006 17:49:41 +0200
Am 29.04.2006 um 16:09 schrieb Phil Faber:
The following code successfully copies a file, byte-by-byte. It
uses fread(&oneByte,1,1,fp1) to read in a byte and fwrite(&oneByte,
1,1,fp2) to write that byte back to disc.
I want to be able to analyse the byte before it writes back to disc
but can't see how to see its value. oneByte is a pointer to the
value - not the value itself. I need to do something like:
oneByteASCII=(value of byte at pointer 'oneByte')
You already got the value of the byte in 'oneByte' (which is not a
pointer but an integer variable) so you may just do with it whatever
you want. You may also consider
- declaring oneByteASCII as 'char' and assigning it with
'oneByteASCII = (char) oneByte;'
- doing the analysis of the value before writing it back to disk (in
your code sample the write statement is before the analysis)
Gruss, Patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden