Thursday, 15 May 2014

C Unsigned int providing a negative value? -


I have a signed integer but when I print it using% d, sometimes there is a negative value it happens?

printing % d will read the integer as the decimal number, its Regardless of the type defined.

To print unsigned numbers, use % u .

That's because they handle variable logic. The compiler pulls the value from the bus stack (like zero * and pointing to the call stack) and printf is to find that your What is the data from the format string given by it?

This is the reason why you need to supply the format string - there is no way of C or a 'base class' (for example in object in Java, for example) ) Normal or predefined toString


No comments:

Post a Comment