Quiz de 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.

Médio 10 perguntas ~6 minutos Aprovação com 80% C17

Escolha um modo

Jogando como visitante: entre para guardar seu XP e sua sequência.

Pergunta de exemplo

Pergunta 1 de 10

What does this print?

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

int main(void) {
    printf("%zu\n", strlen("hello world"));
    return 0;
}
Mostrar a resposta

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.

O que este quiz cobre

  • 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

Perguntas frequentes

Preciso de uma conta?

Não. Qualquer pessoa pode jogar. Entre para guardar seu XP, sequência, badges e histórico.

Posso refazer?

Pode. Sua melhor nota fica salva, e as perguntas e respostas são embaralhadas a cada vez.