• Create Account

### #ActualYoubar

Posted 01 December 2012 - 03:44 AM

I'm just going to get straight to the point:
Using "cout", I can get text, then a variable, then some more text. I wondered if I could replicate that into a string?
e.g
cout << "Hi, I am " << x << "years old."; into a string.

EDIT: I've tried something with a string, but I've gotten a compile error:
invalid operands of types const char[22]' and int' to binary operator<<'

The string is as follows:
string day1_c_1 = "You, along with your " << rs_q_c << " friends, set up camp outside of town. You carried " << rs_q_f << " units of food with you, along with another " << rs_q_m << " units of metal.";

### #2Youbar

Posted 01 December 2012 - 03:44 AM

I'm just going to get straight to the point:
Using "cout", I can get text, then a variable, then some more text. I wondered if I could replicate that into a string?
e.g
cout << "Hi, I am " << x << "years old." into a string.

EDIT: I've tried something with a string, but I've gotten a compile error:
invalid operands of types const char[22]' and int' to binary operator<<'

The string is as follows:
string day1_c_1 = "You, along with your " << rs_q_c << " friends, set up camp outside of town. You carried " << rs_q_f << " units of food with you, along with another " << rs_q_m << " units of metal.";

### #1Youbar

Posted 01 December 2012 - 03:36 AM

I'm just going to get straight to the point:
Using "cout", I can get text, then a variable, then some more text. I wondered if I could replicate that into a string?
e.g
cout << "Hi, I am " << x << "years old." into a string.

PARTNERS