- Ejecutores
-
Aprender
Aprender Python Ejemplos ejecutables, NumPy, pandas y más Aprender IA / Machine LearningRedes neuronales, ML y LLM desde cero Aprender C y C++ Punteros, memoria, STL y C++ moderno Aprender C#Fundamentos, POO, LINQ, async y ejercicios de .NET Aprender MatplotlibGráficos de líneas, barras, dispersión y sectores con visualizadores Aprender RustOwnership, traits, manejo de errores e hilos Aprender GoSlices, interfaces, goroutines y canales Algoritmos en Python Búsqueda, ordenación, recursión y visualizadores O(n) Algoritmos en C y C++ Compara implementaciones en C y C++ Programación para niños ¡Aprende a programar jugando!
- QuizzesNuevo
- RetosNuevo
- Para docentesNuevo
- Actualizaciones
- Invítame a un café
Quiz de C: Structs & typedef
Structs are how C groups related values into one type. This easy quiz covers declaring and initialising structs, copying them, nesting them, the -> operator and typedef, with a look at why struct sizes can surprise you.
Pregunta de ejemplo
Pregunta 1 de 10What does this print?
#include <stdio.h>
struct point {
int x;
int y;
};
int main(void) {
struct point p = {3, 7};
printf("%d %d\n", p.x, p.y);
return 0;
}
Ver la respuesta
A. 3 7 A brace initializer fills the members in the order they are declared, so x gets 3 and y gets 7.
Qué cubre este quiz
- Declaring structs and initialising them, including designated initializers
- Struct assignment copies every member
- Nested structs and the
->operator typedeffor shorter type names- Padding and why you cannot compare structs with
==
Preguntas frecuentes
¿Necesito una cuenta?
No. Cualquiera puede jugar. Inicia sesión para guardar tu XP, racha, insignias e historial.
¿Puedo repetirlo?
Sí. Se guarda tu mejor puntuación, y las preguntas y respuestas se mezclan cada vez.