All fields

“Undefined Behavior” in Information Technology

14 questions across 1 technology.

Information Technology

14 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is undefined behavior (UB) in C++? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
2Why is reading an uninitialized variable undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
3What are common causes of undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
4How do you detect and prevent undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
5How can undefined behavior cause 'impossible' optimizations and bugs? C++ › Undefined BehaviorC++Undefined BehaviorAdvanced
6What is a data race and why is it undefined behavior? C++ › Undefined BehaviorC++Undefined BehaviorAdvanced
7What is the difference between undefined, unspecified, and implementation-defined behavior? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
8Why is signed integer overflow undefined but unsigned overflow defined? C++ › Undefined BehaviorC++Undefined BehaviorIntermediate
9What happens if you dereference a null pointer? C++ › Undefined BehaviorC++Undefined BehaviorBeginner
10What is the strict aliasing rule and how can violating it cause UB? C++ › Undefined BehaviorC++Undefined BehaviorAdvanced
11What is reinterpret_cast and why is it dangerous? C++ › Casting & ConversionsC++Casting & ConversionsIntermediate
12Why are C-style casts discouraged in C++? C++ › Casting & ConversionsC++Casting & ConversionsAdvanced
13What is the difference between static_cast and dynamic_cast for downcasting? C++ › Casting & ConversionsC++Casting & ConversionsAdvanced
14What is std::bit_cast (C++20)? C++ › Casting & ConversionsC++Casting & ConversionsAdvanced