String constant | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

String constant

what is string constant. codeblock says expected ; before string constant but i am unable to get this

10th Nov 2016, 5:50 PM
Praveen Kumar
Praveen Kumar - avatar
4 Answers
+ 3
try: const x = "value"; you are getting the error because const is already a data type. by initializing the variable this way, the variable will be treated as a never changing string
10th Nov 2016, 7:14 PM
Akinni James
Akinni James - avatar
+ 1
Post your code here.
11th Nov 2016, 2:05 AM
Cohen Creber
Cohen Creber - avatar
+ 1
ya
14th Nov 2016, 1:45 PM
Nataly Bshara
Nataly Bshara - avatar
0
You forgot mention ; at the end of statement of declaring the string. Ex: char str[15] ;
16th Nov 2016, 7:26 PM
Avinash Bommidi
Avinash Bommidi - avatar