Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2007

Tip: Looking for answers? Try searching our database.

SIGNED does not allow negative values???

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dani - 19 Apr 2007 12:54 GMT
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???
Bruno van Dooren - 19 Apr 2007 13:02 GMT
> I'm developing for many years, by i have never encountered such problem in
> VC++!
[quoted text clipped - 12 lines]
>
> 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
Dani - 19 Apr 2007 13:22 GMT
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!

> > I'm developing for many years, by i have never encountered such problem in
> > VC++!
[quoted text clipped - 22 lines]
>     Bruno van Dooren  MVP - VC++
>     http://msmvps.com/blogs/vanDooren

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.