Which is not a correct way to declare a string variable?
A. char *string = "Hello World";
B. char string = "Hello World";
C. Char string[20] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'};
D. char string[] = "Hello World";
Correct answer is option B. char string = "Hello World";. Explanation: char string = "Hello World"; is not a correct way to declare a string variable.
0 تعليقات