ควิซ C: Data Types & sizeof

This C quiz covers the basic data types (char, int, double and friends) and the sizeof operator. You will predict output, spot code that does not compile and learn which sizes C guarantees and which depend on the platform.

ง่าย 10 ข้อ ~5 นาที ผ่านที่ 80% C17

เลือกโหมด

กำลังเล่นแบบผู้เยี่ยมชม: เข้าสู่ระบบเพื่อเก็บ XP และ streak

ตัวอย่างคำถาม

ข้อ 1 จาก 10

What does this print?

#include <stdio.h>

int main(void) {
    printf("%zu\n", sizeof(char));
    return 0;
}
ดูเฉลย

B. 1 sizeof(char) is 1 by definition on every platform, because sizeof measures sizes in units of char. It does not count bits, so 8 is the trap.

ควิซนี้มีเนื้อหาอะไรบ้าง

  • char, int, float, double and their usual sizes
  • What the C standard guarantees about type sizes
  • Counting array elements with sizeof
  • Unsigned wrap-around and const variables
  • Valid variable names

คำถามที่พบบ่อย

ต้องมีบัญชีไหม?

ไม่ต้อง ใครก็เล่นได้ เข้าสู่ระบบเพื่อเก็บ XP, streak, เหรียญตรา และประวัติ

ทำซ้ำได้ไหม?

ได้ ระบบเก็บคะแนนที่ดีที่สุดไว้ และสลับคำถามกับตัวเลือกใหม่ทุกครั้ง