C Programming Advanced Quiz 1
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 1
1. What is the primary purpose of the
volatile
keyword in C?
To disable optimization for a variable that may change unexpectedly.
To declare a variable that cannot be changed.
To force a variable into a fixed memory address.
2. Explain the difference between
malloc()
and
calloc()
.
malloc(): uninitialized memory; calloc(): zero-initialized memory.
calloc(): single block; malloc(): multiple blocks.
malloc(): static allocation; calloc(): dynamic allocation.
3. What is a "dangling pointer" and how can it be avoided?
Pointer to freed memory; avoid by setting it to NULL after free().
Pointer not initialized; avoid by always initializing pointers.
Pointer to a missing function; avoid by checking function existence.
4. Describe the memory sections of a typical C program (e.g., text, data, heap, stack).
Text, data, heap, and stack for code, globals, dynamic, and local data.
Only text and data segments are used.
Only registers and cache are used.
5. What is the significance of
const
with pointers, e.g.,
const int *p
vs
int *const p
?
const int *p: constant data; int *const p: constant pointer.
Both have the same meaning and usage.
const int *p: constant pointer; int *const p: constant data.
6. How does the
static
keyword behave for local variables within a function?
Keeps its value between calls and is initialized once.
Makes the variable visible in all source files.
Limits the variable strictly to the current block.
7. What is the role of
extern
keyword in C?
Declares a global variable or function defined elsewhere.
Restricts a variable to the current source file.
Puts a variable into external hardware memory.
8. Explain a "function pointer" and provide a simple use case.
A pointer to a function, used for callbacks or dynamic calls.
A function whose return type is a pointer.
A pointer to the first parameter of a function.
9. What are
bit fields
in C structures and when are they useful?
Fields that pack small integers into bits, saving memory.
Fields used only for bitwise operations on variables.
Fields used to encrypt data stored in a structure.
10. Describe the concept of
endianness
(little-endian vs. big-endian) in C.
The byte order used to store multi-byte values in memory.
The order in which array elements are stored.
The arrangement of bits inside a single byte.
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