Download presentation
Presentation is loading. Please wait.
2
Introduction To Programming
:Author: Muhammad Meer Hazaar Khan Introduction To Programming
3
Salam & Hello! I am Muhammad Meer Hazaar Khan
Alhamdolilah A licensed professional engineer a schooled and skilled in the application of engineering discipline to the creation of software and seeking to share my knowledge and experience with students . You can find me at CS Department Government College University Layyah Campus or
4
Some Words, Muhammad Meer Hazaar Khan
“Freelancing & Enterprenuership“. LinkedIn Profile: ammad-meer-hazaar-khan- 6b11ab96/ Upwork Profile: cers/~01c0fdce3eda554427 YouTube Channel: nel/UC0Ifqps33SDm5LdYTbEkO1A ?view_as=subscriber “Engineering Degree". B.S.C Software Engineering University And Engineering And Technology Taxila Approved By PEC & Washington Accord U.S.A M.S Degree M.S Computer Science Institute Of Southern Punjab Research Area: Semantic Web Gold Medalist Muhammad Meer Hazaar Khan @ Registered Software Engineer Pakistan Engineering Council No Comp 11516 Lecturer Computer Science Government College University Faisalabad Layyah Campus Freelancer at Upwork Enterprenuer More info on how to find and understand the lectures and the blogs post at Official Website: .
5
Seeking knowledge is an obligation upon every Muslim”
(Sunan Ibn Majjah, 224)
6
Let’s start with the first set of slides
1 Basics OF Programming Let’s start with the first set of slides
7
Text Book Object Oriented Programming in c++ any updated Edition by Robert Lafore
8
Array C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
9
declare To declare an array in C++, the programmer specifies the type of the elements and the number of elements required by an array as follows − type arrayName [ arraySize ]; double balance[10];
10
Initializing Arrays You can initialize C++ array elements either one by one or using a single statement as follows − double balance[5] = {1000.0, 2.0, 3.4, 17.0, 50.0};
11
If you omit the size of the array, an array just big enough to hold the initialization is created. Therefore, if you write − double balance[] = {1000.0, 2.0, 3.4, 17.0, 50.0};
12
#include <iostream>
using namespace std; int main () { int n[ 3 ]={1,2,3}; cout<< n[1]; return 0; }
13
String The C-style character string originated within the C language and continues to be supported within C++. This string is actually a one- dimensional array of characters which is terminated by a null character '\0'. Thus a null-terminated string contains the characters that comprise the string followed by a null.
14
char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'};
16
#include <iostream>
using namespace std; int main () { char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'}; cout << "Greeting message: "; cout << greeting << endl; return 0; }
17
Pointers C++ pointers are easy and fun to learn. Some C++ tasks are performed more easily with pointers, and other C++ tasks, such as dynamic memory allocation, cannot be performed without them.
18
#include <iostream>
using namespace std; int main () { int var1; char var2[10]; cout << "Address of var1 variable: "; cout << &var1 << endl; cout << "Address of var2 variable: "; cout << &var2 << endl; return 0; }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.