DSSSB TGT & PGT Computer Science: C & C++ Complete Revision Notes (2014–2025)
In DSSSB TGT (Post Codes 192/14, 91/20, 39/22, 56/24) and PGT Computer Science examinations from 2014 to 2025, C and C++ theory, memory architecture, OOP principles, file handling, exception handling, and STL concepts form a core scoring pillar. Below is a high-yield revision summary covering the exact concepts tested across DSSSB shifts.
1. C Memory Layout & Dynamic Allocation Functions
- Text / Code Segment: Read-only region storing compiled machine instructions.
- Initialized Data Segment: Stores initialized global and static variables.
- BSS (Block Started by Symbol): Stores uninitialized global and static variables (automatically zero-initialized by the OS loader).
- Heap Segment: Grows upward; managed manually via
malloc(),calloc(),realloc(), andfree()in C, ornew/deletein C++. - Stack Segment: Grows downward; stores local (
auto) variables, function parameters, and return addresses in LIFO stack frames.
2. C++ Inheritance Visibility Matrix (Frequently Tested in DSSSB)
| Base Class Member Access | Public Inheritance | Protected Inheritance | Private Inheritance |
|---|---|---|---|
| public | public | protected | private |
| protected | protected | protected | private |
| private | Not Inherited (Inaccessible) | Not Inherited (Inaccessible) | Not Inherited (Inaccessible) |
3. Key C & C++ Rules & Standards Summary
- C Compilation Pipeline: Source File (
.c) → Preprocessor (.i) → Compiler (.s) → Assembler (.o) → Linker (.exe/ binary). - File Open Modes in C:
"r"(read, must exist),"w"(write/truncate or create),"a"(append at EOF),"r+"(read/write existing),"w+"(read/write truncate),"a+"(read/append). - C++ Type Casting Operators:
static_cast(compile-time safe conversions),dynamic_cast(runtime polymorphic downcasting),const_cast(add/removeconstorvolatile),reinterpret_cast(low-level bit reinterpretation). - Smart Pointers (C++11
<memory>):std::unique_ptr(exclusive ownership, non-copyable, movable),std::shared_ptr(reference-counted shared ownership),std::weak_ptr(non-owning observer breaking cyclic references).
Tags
C and C++ PYQ
Computer Science Quiz
DSSSB PGT CS
DSSSB TGT Computer Science
OOPs Concepts
Previous Year Questions
.png)