Review of C Programming
Introduction
C++ builds on C. Reviewing C fundamentals (variables, control flow, functions, arrays, pointers) is essential before OOP.
Definition
C: A procedural language; C++ is a superset adding OOP features.
C++ (C-style) Example
#include <iostream>
using namespace std;
int main(){
int a=5,b=10;
cout<<(a+b)<<endl;
return 0;
}Important Questions
Short Questions
- What is C?
- Name C data types.
- What is a pointer?
- Difference between array and pointer?
Long Questions
- Explain C fundamentals used in C++.
- Discuss pointers in C.
MCQ Practice
1. C is a:
- Procedural language
- OOP language
- Functional language
- Markup language
Answer: procedural.
2. C++ is a:
- Superset of C
- Subset of C
- Replacement of C
- Unrelated
Answer: superset.
3. Entry point in C/C++ is:
- main()
- start()
- begin()
- init()
Answer: main().
4. Arrays in C are:
- Zero-indexed
- One-indexed
- Dynamic by default
- Objects
Answer: zero-indexed.
5. Pointers store:
- Memory addresses
- Values only
- Types
- Functions
Answer: memory addresses.
Quick Revision
- C++ extends C.
- Core: variables, control flow, functions, arrays, pointers.