This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Data type question --- unsigned int variable

I am using Uvision2. For some reasons
I still see the negative value when declared a variable as unsigned interger --
According to the compiler, it supposes to be positive number from 0 - 65536.

Here is the sample test code I have used:

unsigned int A = 0;
while (1)
 {
   printf("\n\r Value= %d", A);
   A++;
 }
Problems:
Value would start from 0 to 32768 and then
-32768 down to 0.

Could somebody in this forum tell me
what I did wrong here.

Thanks in advance,


JIMMY