When I call isalnum() with the pound (£) sign I get an error like this,
Debug Assertion Failed!
Program:...
File: isctype.c
Line: 56
Expression: (unsigned)(c + 1) <= 256
Upon further investigation I discover that int('£') is -93, ah I think isalnum can’t handle negative values?
Then I try char(-93) which gives me a u with a punctuation mark over it.
So to clear things up I try this,
By looking at the output £ should have a value of 156.Code:for(int i = 0; i < 256; i++) { cout<<i<<" is "<<char(i)<<endl; }
I then try the same code but with 0 to -255, this gives me a value of -100 for the pound sign.
Can anybody explain what’s going on because it’s all got me seriously confused.



LinkBack URL
About LinkBacks



