0
Can you print text like this ... cout << ("hello world");
4 Antworten
+ 2
Sure why not?
also can cout << (const char*)("hello world");
+ 2
Do
cout << "hello world";
without the braces
+ 1
Yep you can !
"hello world" is a string. A string is an array of char. Like int types, you can add two string together:
int a(5), b(9);
cout<<a+b; // output : 14
string a("hello "), b("world");
cout<<a+b;//output : hello world
now, look :
int a(6);
int b(5);
int v(2);
cout<<a+(b*v);//output : 16
the brackets are here to tell the priority is to b*v. However, * has the priority on +. So the brackets are useless, but it's not an error.
So ("hello world") is like "hello world" and you can write cout<<("hello world"); but that's USELESS.
You can even write ((((("hello world")))));
Ask if there is something you don't understand
0
i think it'll give u error....(specifically syntax error).