View Single Post
  #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