I'm studying the concept of objects and classes in c++, while doing so, I noticed something about the concatenation.
I just want to clarify what's happening behind this and what's the difference between the two.
I tried doing both and it seemed that the '+' doesn't work properly on the age part which is an integer but works on the strings.
Code:
man.name = "john wick";
man.age = 32;
cout << "The man's name is: " << man.name << endl;
cout << "The man's age is: " << man.age << endl;
Output that I get using '<<':
The man's name is: john wick
The man's age is: 32
and If I change the '<<' into '+' in the man.age, this is what I'm getting.
Output that I get using '+':
The man's name is: john wick
@@