Hi EVOEx
This is the third time you basically say: "thanks for the explanation but I still don't understand can you give me another one?" (and that while showing you didn't even read the posts properly). Maybe you should ask more specific questions about what you don't understand.
Did I really say that? Even if I did, that simply translates to "that I appreciate your effort in helping me, but this is unfortunate that I wasn't able to comprehend it out of my limited knowledge". I'm not an English speaker as I'm sure you have noticed.
I have read almost all the posts carefully and whatever made you think that I didn't read them carefully is because of the fact that sometimes I wrongly interpret the intended meaning because of poor English. I hope you understand this. Thanks.
Sorry if I offended you in anyway.
Let me ask my question again. Please have a look on the below given coded which only differ in the declarations of the variables. The first one has unsigned char and the second signed char.
The output for both is "f" which has ASCII decimal value 102. So, please now help me to understand what's going on and how the two declarations differ?
Code:
#include <iostream>
using namespace std;
int main()
{
unsigned char a = 100;
unsigned char b = a + 59;
cout << "enter a = ";
cin >> a;
cout << b << endl;
system("pause");
}
Output from the Command Prompt:
Code:
enter a = 100
ƒ
Press any key to continue . . .
Code:
#include <iostream>
using namespace std;
int main()
{
signed char a = 100;
signed char b = a + 59;
cout << "enter a = ";
cin >> a;
cout << b << endl;
system("pause");
}
Output from the Command Prompt:
Code:
enter a = 100
ƒ
Press any key to continue . . .