Vidyalelo
C Programming · Q15

Arrays and Strings

Programming · C Programming · question 15

Q15

What is the correct way to declare and initialize a string in C?

A.
char str[10] = "Hello";
Answer
B.
char str = "Hello";
C.
string str = "Hello";
D.
str = "Hello";

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board