ควิซ C: string.h Functions

This C quiz covers the everyday functions from string.h and stdio.h for working with text. You will predict their results and spot the mistakes that cause wrong comparisons, missing terminators and overflows.

ปานกลาง 10 ข้อ ~6 นาที ผ่านที่ 80% C17

เลือกโหมด

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

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

ข้อ 1 จาก 10

What does this print?

#include <stdio.h>
#include <string.h>

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

C. 11 strlen counts every character before the terminator, including the space: 5 + 1 + 5 = 11. It does not count the '\0' itself, which is why 12 is wrong.

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

  • Length, copy and append: strlen, strcpy, strcat
  • Comparing with strcmp instead of ==
  • Searching with strchr and strstr
  • Why strncpy may leave out the terminator
  • Safe formatting with snprintf

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

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

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

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

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