Michal Nazarewicz wrote in message <87************@erwin.mina86.com>...
>"ruffiano" <ro************@yahoo.comwrote:
>>Hi, can someone tell me if a C++ string (std::string) represents a
binary or an ASCII string?
"Jim Langston" <ta*******@rocketmail.comwrites:
>Anything you can put into a char (0-255)
The range you've given is wrong or at least misleading. I haven't had
much experience with various platforms but I've never seen a compiler
which treated char as unsigned by default,
**and with unsigned chars the range would be rather -128..127.**
[ Let's not mislead newbies <G]
I think Michal meant 'signed char', not 'unsigned char'.
#include <limits// and <iostream>, <ostream>
{
using std::cout // for NG posting
cout<<" sizeof(char) ="<<sizeof(char)<<std::endl;
cout<<" sizeof(unsigned char) ="<<sizeof(unsigned char)<<std::endl;
cout <<"std::numeric_limits<char>::max() ="
<<int(std::numeric_limits<char>::max())<<std::endl ;
cout <<"std::numeric_limits<char>::min() ="
<<int(std::numeric_limits<char>::min())<<std::endl ;
cout <<"std::numeric_limits<unsigned char>::max() ="
<<int(std::numeric_limits<unsigned char>::max())<<std::endl;
cout <<"std::numeric_limits<unsigned char>::min() ="
<<int(std::numeric_limits<unsigned char>::min())<<std::endl;
}
/* -- output -- (MinGW(GCC), x86)
sizeof(char) =1
sizeof(unsigned char) =1
std::numeric_limits<char>::max() =127
std::numeric_limits<char>::min() =-128
std::numeric_limits<unsigned char>::max() =255
std::numeric_limits<unsigned char>::min() =0
*/
--
Bob R
POVrookie