Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator missing? #6

Open
justf0rfun opened this issue Sep 18, 2019 · 2 comments
Open

Operator missing? #6

justf0rfun opened this issue Sep 18, 2019 · 2 comments

Comments

@justf0rfun
Copy link

I am just refreshing my c++ syntax knowledge has been unused for years. Isn't there an operator like '+' missing in the literals section at line

"hello" "world" // Concatenated strings

Shouldn't it be?

"hello" + "world" // Concatenated strings

@smnasirhussain
Copy link

Try this anywhere e.g. in a cout statement:
cout<< "abcd" "efgh"<<endl;

Output:
abcdefgh

@singhaln93
Copy link

@justf0rfun @smnasirhussain
Using Sting header file you can Concatenate the two string variables. as shown below (mentioned at section string-Variable sized character array in the cheat sheet).

#include // Include string (std namespace)
string a="Hello";
string b=" World";
cout << a+b;

Output:
Hello World

@mortennobel Please close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants