- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
C Multidimensional Array MCQ | What Happens with printf("%s", a)? | Pointer Decay Trick
In this video, we analyze a tricky C programming MCQ involving a 3-dimensional character array and the use of printf("%s", **a).
The array is declared as:
char a[2][3][3] = { 'c','o','u', 'n','t','w', 'o','r','d' };
Key concepts involved:
Character arrays in multiple dimensions
Pointer decay when using %s
How **a is interpreted
Why using %s is dangerous when the memory is not null-terminated
Since **a points to 'c', but it is not a C-string (no terminating \0), using %s will read beyond valid memory.
This results in undefined behavior, most likely Segmentation Fault.
Correct Answer: d) Segmentation Fault
Keywords
multidimensional array MCQ C, printf %s undefined behavior, C pointer decay MCQ, segmentation fault due to %s, C tricky output questions, character array without null terminator, C interview MCQ, multidimensional char array explanation, pointer dereference MCQ C.
Hashtags
#cprogramming #clanguage #cmcq #arrays #multidimensionalarray #pointer #cinterviewquestions #codingmcq #dailycoding #1printf
Видео C Multidimensional Array MCQ | What Happens with printf("%s", a)? | Pointer Decay Trick канала 1printf
The array is declared as:
char a[2][3][3] = { 'c','o','u', 'n','t','w', 'o','r','d' };
Key concepts involved:
Character arrays in multiple dimensions
Pointer decay when using %s
How **a is interpreted
Why using %s is dangerous when the memory is not null-terminated
Since **a points to 'c', but it is not a C-string (no terminating \0), using %s will read beyond valid memory.
This results in undefined behavior, most likely Segmentation Fault.
Correct Answer: d) Segmentation Fault
Keywords
multidimensional array MCQ C, printf %s undefined behavior, C pointer decay MCQ, segmentation fault due to %s, C tricky output questions, character array without null terminator, C interview MCQ, multidimensional char array explanation, pointer dereference MCQ C.
Hashtags
#cprogramming #clanguage #cmcq #arrays #multidimensionalarray #pointer #cinterviewquestions #codingmcq #dailycoding #1printf
Видео C Multidimensional Array MCQ | What Happens with printf("%s", a)? | Pointer Decay Trick канала 1printf
Комментарии отсутствуют
Информация о видео
4 декабря 2025 г. 17:31:14
00:00:58
Другие видео канала




















