aayush  sharma
aayush sharma

Reputation: 187

Bytes in Objective C

I am trying to declare a byte which I did in Visual C++ as this:

static CONST BYTE NEW_REGISTRATION              = 0x30; 

but in Objective C I have done as thus:

const char  NEW_REGISTRATION                = 0x30; 
NSLog(@"output here = %C", NEW_REGISTRATION);

and my output seems to be just simply

output here = 0

is it an encoding issue or am I getting the type wrong?

Upvotes: 0

Views: 918

Answers (1)

Krokodylowy
Krokodylowy

Reputation: 620

Ascii 0x30 represents 0 character. Try with something else e.g. 0x35. See table: http://www.asciitable.com/

Upvotes: 2

Related Questions