pointers

This is a discussion on pointers within the C Programming forums, part of the General Programming Boards category; Okay i have this code Code: #include <stdio.h> int main() { int i; int *ptr; int **pptr; i = 01234; ...

  1. #1
    Registered User datainjector's Avatar
    Join Date
    Mar 2002
    Posts
    356

    pointers

    Okay i have this code
    Code:
    #include <stdio.h>
    
    int main()
    {
        int i;
        int *ptr;
        int **pptr;
    
        i = 01234;
        ptr =  &i;
        pptr = &ptr;
    
        printf("**pptr = %u\n", **pptr );
     
        return 0;
    }
    I get 668 but when i remove the 0 i get 1234 .If i put 3 for i it gives me 3 but if i put a 0 like 03 it gives me 83 .Why does it do that ..Thanks
    "I wish i could wish my wishs away"

    "By indirections find directions out" -- William Shakespears

    "Do what thou wilt shall be the whole of the law" -- Crowley "THE BEAST 666"

    Mizra -> love = Death...
    RDB(Rocks yooo)..

    http://www.cbeginnersunited.com

    Are you ready for the Trix ???

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Zero before a number denotes "octal", which is a base-eight number system instead of base-ten. 0x in front of a number uses hex which is base-sixteen.

    It has nothing to do with pointers.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  2. function pointers
    By benhaldor in forum C Programming
    Replies: 4
    Last Post: 08-19-2007, 10:56 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 12:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21