C | String | Question 8
Output?
int main() { char a[2][3][3] = {'g','e','e','k','s','q','u','i','z'}; printf("%s ", **a); return 0; } |
chevron_right
filter_none
(A) Compiler Error
(B) geeksquiz followed by garbage characters
(C) geeksquiz
(D) Runtime Error
Answer: (C)
Explanation: We have created a 3D array that should have 2*3*3 (= 18) elements, but we are initializing only 9 of them. In C, when we initialize less no of elements in an array all uninitialized elements become ‘\0′ in case of char and 0 in case of integers.
Quiz of this Question
Recommended Posts:
- C | String | Question 3
- C | String | Question 4
- C | String | Question 9
- C | String | Question 16
- C | String | Question 11
- C | String | Question 5
- C | String | Question 15
- C | String | Question 7
- C | String | Question 6
- C | String | Question 14
- C | String | Question 2
- C | String | Question 10
- C | String | Question 12
- C | String | Question 13
- C | String | Question 1



