0
string c++
Somewhere I have found an exercise where I write a code whose result is correct on my compiler but compiler on this site report error. Error is said to be missing the last quotation mark on string ("). I don't know how to fix it. Any idea? https://code.sololearn.com/cU0TOBwej8ae/?ref=app
4 Answers
+ 1
TeaserCode code is working fine
I belive you are getting surprised that why double quotes are not getting printed... If so, please find below details:
String variable is assigned a value within double quote.
For example,
String s = "test"; means test is value of variable s rather than "test or "test"
If you want double quote as value within the string , you can use \" for that
Try below in your code example for variable a in line 19 and see output
"\"the_sum_is_shining\""
+ 1
Post your code that showing error . That may helps to find problem.. otherwise no idea !!!!
edit: tq for edit
+ 1
Your linked code is working without any error.
0
It is said for result:
expected: "theSunIsShining"
actually: "theSunIsShining