- 1

If string + int is not allowed...

what if I want to write street 85 or my +age +is +53 for exaple

16th Oct 2016, 6:15 AM
Rayan Aridi
Rayan Aridi - avatar
3 Answers
+ 8
In c++ string+int is allowed, however it returns string data type and conjoints the input. for ex. if you write cout <<85+"age"; you would get 85age. So you can write cout<<85+"-age"; to get 85-age
16th Oct 2016, 7:38 AM
Nelli
Nelli - avatar
+ 3
When U put the numbers in "" its defined as caracters not numbers. For example, "abc1234def56" is a string or an array of characters
26th Oct 2016, 7:10 PM
Moein Ghandehari
Moein Ghandehari - avatar
- 2
cout<<"street 85"; cout<<"my age is 53"; cout<<string<<" "<<int;
16th Oct 2016, 7:41 AM
marcram