- Esecutori
-
Impara
Impara Python Esempi eseguibili, NumPy, pandas e altro Impara l'IA / Machine LearningReti neurali, ML e LLM da zero Impara C e C++ Puntatori, memoria, STL e C++ moderno Impara C#Fondamenti, OOP, LINQ, async ed esercizi .NET Impara MatplotlibGrafici a linee, barre, dispersione e torta con visualizzatori Impara RustOwnership, trait, gestione degli errori e thread Impara GoSlice, interfacce, goroutine e canali Algoritmi Python Ricerca, ordinamento, ricorsione e visualizzazioni O(n) Algoritmi C e C++ Confronta le implementazioni in C e C++ Programmazione per bambini Impara a programmare giocando!
- QuizNuovo
- SfideNuovo
- Per docentiNuovo
- Aggiornamenti
- Offrimi un caffè
Quiz di C: Pointer Basics
This C quiz checks the first ideas about pointers - what & and * do, how a pointer lets a function change the caller's variable and why NULL must be checked. It is for learners who have just met pointers and want to make them click.
Domanda di esempio
Domanda 1 di 10What does this print?
#include <stdio.h>
int main(void) {
int x = 5;
int *p = &x;
*p = 8;
printf("%d\n", x);
return 0;
}
Mostra la risposta
B. 8 p holds the address of x, so *p = 8 writes 8 into x itself. There is only one integer here, reached under two names.
Cosa copre questo quiz
&xgives an address,*pfollows it- Changing a variable through a pointer
- Passing pointers so a function can modify its arguments
- Comparing pointers vs comparing the values they point to
NULLand theint* a, btrap
Domande frequenti
Serve un account?
No. Chiunque può giocare. Accedi per salvare XP, serie, badge e cronologia.
Posso rifarlo?
Sì. Il tuo miglior punteggio resta salvato, e domande e risposte vengono mescolate ogni volta.