Hi all,
I'm transistioning from the networking end of things and moving to the programming side, so, even though I've been around here for quite awhile, I have a pretty basic queston: since the char data type has a minimum range values between -127 to 128, how is a letter character or symbol ever given a negative value? Also, can the char data type hold more than one character - up to the permissibe range limit - or is it constrained to a single character value?
TIA
PS: fwiw, I'm using the Digital Mars (TM) C++ compiler, as per the course requirements.
Hi TIA... it is good that you are maximizing your capability not just in one aspect... i appreciated that...
back to your question, about char data type....actually a char data type is just equivalent to a byte data type in other progrmming languages such as java, visaul basic and others.. a char data type is just an 8 bit size of data yielding into 256 combinations... char could be used with two different attributes (signed, unsigned) the default is signed, meaning when you did not define it as unsigned(absolute value from 0 to 255), it is considered as signed(-127 to 128)
symbols or (i think u mean is ascii characters) are assigned with an absolute value ranges from 0 to 255(example A=65, B=66, 13=ENTER 8=BACKSAPCE..etc)
Also, can the char data type hold more than one character - up to the permissibe range limit - or is it constrained to a single character value?
>> yes.. a char data type hold more than one character (and it becomes a string) only when you declare it as an array example(char name[3]="TIA" , string[80]="daniweb") as long as it maximum index is greater than the length of the string...
Im not so good in explaining things.. but im trying my best to explain it to you.. hope you understand....
any more question and clarification just e-mail me <<email snipped>>..... im to glad to read your comment on my explaination... ^__^