Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Programming (http://www.go4expert.com/forums/programming-forum/)
-   -   Help with outputting an integer (http://www.go4expert.com/forums/help-outputting-integer-t7441/)

davegibelli 22Nov2007 00:37

Help with outputting an integer
 
With the simple code below...

char ptr[4]={0x00, 0x00 ,0x00, 0xff};

printf("%u", *ptr);

you would expect to get 255 BUT I get zero...why?

shabbir 22Nov2007 10:17

Re: Help with outputting an integer
 
Why you are expecting 255. ptr is the address of the base location and * means value at that location and so it should be what you are getting.


All times are GMT +5.5. The time now is 05:18.