Go to Post The first law of programming is that there are always ways of doing things quicker and in less space than you already are. - jgannon [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 21-06-2002, 22:51
Mike Soukup's Avatar
Mike Soukup Mike Soukup is offline
Software guy
FRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Schaumburg, IL
Posts: 797
Mike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond reputeMike Soukup has a reputation beyond repute
Don't worry about not knowing this kind of stuff, they don't teach it in intro CS classes, they're more focused on programming basics & syntax. 200 level classes usually introduce how variables are stored in memory and interpreted.

If you want to know more about how computers deal with negative numbers, search on google for 'twos compliemnt.' I'm not sure how much you know about computers, but all numbers are stored as hex values which don't have +/- . Computers use twos compliment to store numbers because addition works. Using twos compliment, if you add a positive hex number and a negative number, the sum will be the correct value.

Now after making you read all that, I'll answer your other question. I'm not very familiar with C++ and cout, but I found the solution on google groups:
cout << unsigned(my_byte) << endl;

I tested it and it works, but for some reason my compiler thinks a char is 4 bytes instead of 1

Mike
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashboard Decoder Release Version 1.0 Now Available! archiver 2000 1 23-06-2002 22:50


All times are GMT -5. The time now is 07:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi