Data types and expressions. I really need to know it? (Base of 8 etc.)

Discussion in 'iOS Programming' started by RobertD63, Aug 2, 2009.

  1. RobertD63 macrumors 6502

    Joined:
    Feb 17, 2008
    Location:
    A place
    #1
    Im reading this book, and it teaches Obj-c in a way so you dont need any prior knowledge of C or any other languages. So Im on the 4th chapter right after classes and methods and ivars. Data types and expressions. Do I really need to know this? Its really confusing. For example here is a line for the book:
    What?!?! Now thats confusing. :eek:
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Which book?
     
  3. RobertD63 thread starter macrumors 6502

    Joined:
    Feb 17, 2008
    Location:
    A place
    #3
    Title: Programming in Objective-C 2.0
    By: Stephen G. Kochan
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Octal isn't used very much in iPhone development. But there's not much to it. Almost the same as hex, base 16. You have a leading character or phrase that indicates the type of the number. In hex it's 0x, in octal it's 0. Then you have digits after that in the numbering scheme. In hex they go from 0 - F, in octal they go from 0 - 7.

    int fifty = 0x32;
    int sixty = 074;

    Re-read what I said and re-read the text you quoted.

    This octal notation is used in C, C++, and Objectve-C. Don't know if other languages use it.
     
  5. RobertD63 thread starter macrumors 6502

    Joined:
    Feb 17, 2008
    Location:
    A place
    #5
    Okay I get it now. 16= 020 in base8. Easy stuff now ;)
     
  6. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #6
    Stuff like this some people may have to use often, I myself never had to mess with it but its always good to know it exists so that you are aware of it and can reference it if need be.


    There are lots of things in programming you may never use or have to reference because you don't use them enough to remember them.
     

Share This Page