Closed Thread Icon

Topic awaiting preservation: Advanced CPP question (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24795" title="Pages that link to Topic awaiting preservation: Advanced CPP question (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Advanced CPP question <span class="small">(Page 1 of 1)</span>\

 
InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-25-2005 09:21

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 01-25-2005 16:01

If it works let it be. You can always force it one way or the other with compiler options.

Dan @ Code Town

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 01-25-2005 16:11
code:
#define   byte unsigned char
#define word unsigned short
#define dword unsigned long

#define sbyte signed char
#define sword signed short
#define sdword signed long

Shazam!

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-25-2005 16:27

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana, USA
Insane since: Aug 2000

posted posted 01-25-2005 22:23

From your description it sounds as if you are just moving information into and out of the chars, not doing any arithmetic or other kinds of operations. As long as all you are doing is assigning and reading data, the sign of the char will make no difference.

The one place this is not true is when you move information from a signed char to a signed int and the sign bit is set in the char. This will cause the sign bit to be propagated in the int. This may also happen when moving to an unsigned int, but I don't remember for sure. You can, of course, stop the sign propogation by casting the char as an unsigned char when you make the assignment.

Anyway, the only time the sign of the char should be an issue is when the sign bit of a signed char is set (which it may be because you are using the char to store bytes, not characters). But even then it will not be an issue as long as you are doing I/O and assigning the data to other char data.



.

-- not necessarily stoned... just beautiful.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 01-26-2005 10:29

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu