I am newbie to c++ while going through the literature and tutorials I came across a anaomaly wherein for the given code,
` //Include the iostream, which is used to include libraries for the i/o operation for the console #include
using namespace std;
int main (void){
unsigned int var1(0xFF);//Direct initialization of the variable
//Capture the value from the cin
cout << "Initial value is " << var1 << endl;
cout << "Please enter the value\n";
cin >> var1;
//Display the value
cout << "Enterd value is " << var1 << endl;
cout << "*******END******" << endl;
//Returning '0' for successful app execution
return 0;
}`
When input is given as 'A' the output is displays as '0' and that's where the confusion exists, please let me know the answers. Thank you all
Aucun commentaire:
Enregistrer un commentaire