Квиз по C: Pointer Basics

This C quiz checks the first ideas about pointers - what & and * do, how a pointer lets a function change the caller's variable and why NULL must be checked. It is for learners who have just met pointers and want to make them click.

Лёгкий 10 вопроса ~5 минуты Проходной балл: 80% C17

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What does this print?

#include <stdio.h>

int main(void) {
    int x = 5;
    int *p = &x;
    *p = 8;
    printf("%d\n", x);
    return 0;
}
Показать ответ

B. 8 p holds the address of x, so *p = 8 writes 8 into x itself. There is only one integer here, reached under two names.

Что проверяет этот квиз

  • &x gives an address, *p follows it
  • Changing a variable through a pointer
  • Passing pointers so a function can modify its arguments
  • Comparing pointers vs comparing the values they point to
  • NULL and the int* a, b trap

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.