- Executores
-
Aprender
Aprender Python Exemplos executáveis, NumPy, pandas e mais Aprender IA / Machine LearningRedes neurais, ML e LLMs do zero Aprender C e C++ Ponteiros, memória, STL e C++ moderno Aprender C#Fundamentos, POO, LINQ, async e exercícios .NET Aprender MatplotlibGráficos de linha, barras, dispersão e pizza com visualizadores Aprender RustOwnership, traits, tratamento de erros e threads Aprender GoSlices, interfaces, goroutines e channels Algoritmos em Python Busca, ordenação, recursão e visualizações O(n) Algoritmos em C e C++ Compare implementações em C e C++ Programação para crianças Aprenda a programar brincando!
- QuizzesNovo
- DesafiosNovo
- Para professoresNovo
- Atualizações
- Me pague um café
Quiz de C: Pointers & Arrays
Arrays and pointers are closely linked in C but they are not the same thing. This quiz checks array-to-pointer decay, indexing through pointers, the cases where an array keeps its own type, and arrays of strings.
Pergunta de exemplo
Pergunta 1 de 10What does this print?
#include <stdio.h>
int main(void) {
int a[] = {10, 20, 30, 40};
printf("%d %d\n", *(a + 2), 2[a]);
return 0;
}
Mostrar a resposta
A. 30 30 a[i] is defined as *(a + i), and addition does not care about order, so 2[a] is *(2 + a), the same element. Never write 2[a] in real code, but it shows how indexing works.
O que este quiz cobre
a[i]is defined as*(a + i)- Where an array does not decay:
sizeofand&a - Passing part of an array to a function
char s[]vschar *s- Arrays of strings and pointers to arrays
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.