Skip to content
VUBuddy

CS201 Final Term Notes by Almas Afzal

Introduction to Programming PDF 293 KBUpdated 23 Oct 2026
Final term past paper CS201 Final Term Notes by Almas Afzal PDF 293 KB
vubuddy.com
Type
Final term past paper
Course
CS201 Introduction to Programming
Size
PDF 293 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 293 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 15. Download the file for all 15 pages.

CS-201 FINAL TERM NOTES (THEORETICALLY) · 1.Pre-processor: · Old: #include <iostream.h> · New: #include <iostream> · 2.Include Directive: · It is written as: · #include “myHeaderfile.h” · 3. Define Directive:

Also called Macros. Macros is a special name, which is substituted in the code by its definition and, as a result we get an expand code.

With the define directive , we can define PI as:

#define Pi 3.1415926

Jab macros ko use Kiya jata hai to is mein assignment operator Nahin lagaya jata,, without Assignment operator, value assign ki jati hai

4. Pre-processor directives (Mcqs) · • #include <filename> · • #include “filename” · • #define · • #undef · • #ifdef · • #ifndef

  • #if

• #else · • #elif · • #endif · • #error · • #line · • #pragma · • #assert · 5. Macros:

Macros are classified into two categories. First: The first type of macros can be written using #define. The value of PI can be defined as:

#define Pi 3.1415926

Second: The second type of macros takes arguments. It is also called a “parameterized macros”.

Consider the following: · #define square (x) x*x · Correct definition of the macros will be: · #define square (x) ((x)*(x)) · 1.Memory Allocation:

Memory will be allocated during the execution of program.

There are two types of memory · 1. Static · 2. Dynamic

Static: Static Allocation is also called “Compile time allocation”. This memory allocation is defined at the time when we write the program while exacting knowing how much memory is required. Static memory stored in “Stack”. Dynamic: Whenever we don’t know in advance how much memory space would be required , it is better to use dynamic memory allocation. Dynamic memory stored in “heap”.

2.Void Pointer:

Jab b ap void pointer ko use Karen gy to sab say pehly apko uski “casting” krni pryge....

Casting: Cast means the conversion of “void” into a type of pointer that can be used for native data type like int, char, float etc.....

All CS201 files →
CS201 Introduction to Programming All CS201 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.