C Programming Advanced Quiz 2
Select your answers and check your results. Use Reset to start again.
Search
Practice Pronunciation (Merriam-Webster)
Navigation
Python Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Python Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Python Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
SQL Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
JavaScript Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C# Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Java Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Beginner Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Intermediate Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
C Programming Advanced Quizzes
Quiz 1,
Quiz 2,
Quiz 3,
Quiz 4,
Quiz 5
Advanced Quiz 2
1. How can you simulate object-oriented features like polymorphism in C?
Using function pointers and structs to create a vtable.
C natively supports classes and objects.
Using a large switch-case statement.
2. What is a "preprocessor directive" and give an example other than
#include
?
#define
for macros or
#ifdef
for conditional compilation.
Commands executed by the linker before compilation.
Functions that prepare data for processing.
3. What is the purpose of
typedef
?
Creates an alias or new name for an existing data type.
Defines a completely new variable type.
Declares a global function prototype.
4. Explain what a "segmentation fault" is and what typically causes it.
Accessing memory the program doesn't own, like null pointers.
Caused by an infinite loop in the program.
Due to insufficient disk space during execution.
5. When would you use a
union
instead of a
struct
?
Store different data types in same memory, one at a time.
Group related data of different types together.
When all members must be the same data type.
6. How can
setjmp()
and
longjmp()
be used in C?
For non-local jumps across function calls like exceptions.
To define and call functions dynamically.
To set and retrieve environment variables.
7. Difference between "pass-by-value" and "pass-by-reference" in C function arguments?
Value: copies argument; Reference: passes address via pointer.
Reference is always faster for all data types.
Value modifies original; Reference does not.
8. Explain the concept of "pointer arithmetic".
Adding/subtracting from pointers, scaled by pointed-to type size.
Calculating the value stored at a pointer's address.
Arithmetic operations on integer variables only.
9. What is the significance of the
_Atomic
keyword in C11?
Ensures indivisible operations for multi-threaded code.
Declares a variable as constant.
Stores variable in atomic memory hardware.
10. How does
register
storage class specifier work?
Suggests compiler use CPU register for faster access.
Registers variable with the operating system.
Makes variable visible only within a register.
Previous
Check Quiz
Reset
Next
Other
Timer
00:00
Start
Stop
Reset
Vocabulary Quiz
Score: 0
Reset Score
Submit Answer
Next Word
Spin the Wheel
SPIN
Promo's
Explore More
C# Documentation
C# Tutorials