I'm just going to copy and paste the sentence from the file. There is an error in my code. And the color changes in the middle What should I do?
using namespace std;
int main(){
const char* msg = "hello
my
world!
...
end"
}
There are two ways.
The compiler will paste it on its own and no spaces will be added between them.
const char *msg =
"hello"
"my"
"world!"
...
"end";
Results:
hello c++ world!
Note that this method adds a space between the strings.
int main(){
char* msg = "hello \
c++ \
world!";
cout << msg << endl;
}
Results:
hello c++ world!
© 2024 OneMinuteCode. All rights reserved.