SIGNED does not allow negative values???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I'm developing for many years, by i have never encountered such problem in
VC++!
I tried doing the simplest test:
Create new solution -> Win32 project...

In the main procedure I wrote this:
int i=-1;

And breakpoint on the next line.

The value of i is 0xffffff !!!

I tried writing singed int, the same thing happens..
Tried all of the data types, nada.

Can anyone explain this???
 
I'm developing for many years, by i have never encountered such problem in
VC++!
I tried doing the simplest test:
Create new solution -> Win32 project...

In the main procedure I wrote this:
int i=-1;

And breakpoint on the next line.

The value of i is 0xffffff !!!

I tried writing singed int, the same thing happens..
Tried all of the data types, nada.

Can anyone explain this???

Yes.
You display debug information in HEX. The hex for -1 is 0xFFFFFFFF in 2's
complement.
Turn of HEX display for your debug information (e.g. from within the watch
window) and you should be fine.

Kind regards,
Bruno van Dooren MVP - VC++
http://msmvps.com/blogs/vanDooren
 
You misunderstood...
I wrote 0xffffff so it is more readable than 16777215...
I already checked the values in decimal view...

The problem appears to be something with too loaded memory :-D
After a restart, everything went back to normal...

Thanks anyway!
 
Back
Top