- 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: Undefined Behavior
Undefined behaviour is the part of C where the standard makes no promises, and modern optimisers take full advantage of that. This hard quiz asks you to recognise common cases, tell them apart from implementation-defined behaviour and explain why "it works on my machine" proves nothing.
Domanda di esempio
Domanda 1 di 10What does i = i++ + 1; do?
Mostra la risposta
B. It is undefined behaviour: i is modified twice without a sequence point between the changes Both the ++ and the assignment write i, and C does not order those two writes. That is undefined behaviour, so different compilers and optimisation levels may give different results.
Cosa copre questo quiz
- What "undefined" means compared with implementation-defined
- Signed overflow, oversized shifts and unsequenced modifications
- Out-of-bounds access and strict aliasing
- How optimisers use UB to delete code
- Finding UB with sanitizers
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.