• 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: Phil Faber <email@hidden>
  • Date: Sat, 29 Apr 2006 20:29:45 +0100

On 29 Apr 2006, at 19:07, Paul Lynch wrote:

On 29 Apr 2006, at 18:24, Phil Faber wrote:

But oneByte has a value of 2067035792! Which is why I assumed it was a pointer. I was expecting an 8-bit byte number from 0 to 255; 65, for example, being the ASCII value for 'A'.

int oneByte, oneByteASCII;

int isn't one byte, and assumes signed. Default integer in gcc is probably 4 bytes, and short is 2. fread is putting the byte into the top byte of your 4 byte int, which may impact the sign bit; the effect may also depend on the endianness of the system you are running it on.


Make oneByte and oneByteASCII char and it will do what you want. Well, so far.

..but how can I then access the ASCII value of that character? I specifically need that value. In BASIC I would have done something like:


num=ASC(string$)

Re endianness, I'm running PowerPC at the moment. (Only just learned what endianness meant a few days back at the Xcode workshop in London!)

I hate being a newbie!


___________________________________________________________ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
_______________________________________________
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: Eric Schlegel <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>)
 >Re: How to access the value that a pointer is pointing to (From: Patrick Seemann <email@hidden>)
 >Re: How to access the value that a pointer is pointing to (From: Phil Faber <email@hidden>)
 >Re: How to access the value that a pointer is pointing to (From: Paul Lynch <email@hidden>)

  • Prev by Date: Re: Animated split view collapsing
  • Next by Date: Enabling undo in a CoreData app?
  • 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