• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to access the value that a pointer is pointing to
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to access the value that a pointer is pointing to
      • From: Phil Faber <email@hidden>
References: 
 >-[NSAttributedString initWithData:...] compresses spaces? (From: Glen Simmons <email@hidden>)
 >How to access the value that a pointer is pointing to (From: Phil Faber <email@hidden>)

  • Prev by Date: Re: Do I need private accessor methods?
  • Next by Date: Re: Should I prefix my private instance variables?
  • Previous by thread: Re: How to access the value that a pointer is pointing to
  • Next by thread: Re: How to access the value that a pointer is pointing to
  • Index(es):
    • Date
    • Thread