Introduction To Programming

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Advertisements

Data Structures (Second Part) Lecture 2 : Pointers Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University.
Dale/Weems/Headington
What Data Do We Have? Sections 2.2, 2.5 August 29, 2008.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
1 9/1/06CS150 Introduction to Computer Science 1 What Data Do We Have? CS 150 Introduction to Computer Science I.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
1 Array, Pointer and Reference ( I ) Ying Wu Electrical Engineering and Computer Science Northwestern University EECS 230 Lectures.
CS150 Introduction to Computer Science 1
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
Comp 245 Data Structures Linked Lists. An Array Based List Usually is statically allocated; may not use memory efficiently Direct access to data; faster.
1 C++ Syntax and Semantics, and the Program Development Process.
Chapter 8: Arrays and Functions Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills
Lecture – Pointers1 C++ Pointers Joseph Spring/Bob Dickerson School of Computer Science Operating Systems and Computer Networks Based on notes by Bob Dickerson.
Pointers in C++. Topics Covered  Introduction to Pointers  Pointers and arrays  Character Pointers, Arrays and Strings  Examples.
COMPUTER PROGRAMMING. Array C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An.
12/14/2016CS150 Introduction to Computer Science 1 Announcements  Website is up!   All lecture slides, assignments,
POINTERS IN C. Introduction  A pointer is a variable that holds a memory address  This address is the location of another object (typically another.
Java & C++ Comparisons How important are classes and objects?? What mechanisms exist for input and output?? Are references and pointers the same thing??
C++ Programming Lecture 14 Arrays – Part I The Hashemite University Computer Engineering Department (Adapted from the textbook slides)
Multidimensional Arrays tMyn1 Multidimensional Arrays It is possible to declare arrays that require two or more separate index values to access an element.
Arrays C provides the option to the user to combine similar data types into a single entity It followed contiguous memory allocation.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Pointers What is the data type of pointer variables?
Introduction to C++ Programming Language
Computer Programming BCT 1113
Computing Fundamentals
Command Line Arguments
Learning Objectives Pointers Pointer in function call
CSC 113: Computer Programming (Theory = 03, Lab = 01)
Pointers and Pointer-Based Strings
CSC113: Computer Programming (Theory = 03, Lab = 01)
COMP 2710 Software Construction Pointers
Pointers Psst… over there.
Andy Wang Object Oriented Programming in C++ COP 3330
Pointer Data Type and Pointer Variables
Dynamic Memory Allocation Reference Variables
Pointers Psst… over there.
Arrays C provides the option to the user to combine similar data types into a single entity It followed contiguous.
Programming -2 برمجة -2 المحاضرة-5 Lecture-5.
Chapter 9 - Arrays Outline 6.1 Introduction 6.2 Arrays
CS1201: Programming Language 2
Pointers & Functions.
Declaration, assignment & accessing
CS150 Introduction to Computer Science 1
By Hector M Lugo-Cordero September 17, 2008
Introduction To Programming
Introduction To Programming
CS1201: Programming Language 2
7 Arrays.
Introduction To Programming
Introduction To Programming
Salam & Hello! I am Muhammad Meer Hazaar Khan
Introduction To Programming
Pointers and Pointer-Based Strings
Salam & Hello! I am Muhammad Meer Hazaar Khan
Arrays Arrays A few types Structures of related data items
Arrays C provides the option to the user to combine similar data types into a single entity It followed contiguous.
Pointers and dynamic objects
Pointers & Functions.
Pointer Data Type and Pointer Variables
CS 144 Advanced C++ Programming February 12 Class Meeting
Pointer Data Type and Pointer Variables
C++ Array 1.
Salam & Hello! I am Muhammad Meer Hazaar Khan
Programming Fundamental
system and network administration
Dr. Khizar Hayat Associate Prof. of Computer Science
Introduction to C CS 3410.
Presentation transcript:

Introduction To Programming :Author: Muhammad Meer Hazaar Khan Introduction To Programming

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 meerhazaarkhan@yahoo.com

Some Words, Muhammad Meer Hazaar Khan “Freelancing & Enterprenuership“. LinkedIn Profile: https://www.linkedin.com/in/muh ammad-meer-hazaar-khan- 6b11ab96/ Upwork Profile: https://www.upwork.com/freelan cers/~01c0fdce3eda554427 YouTube Channel: https://www.youtube.com/chan 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: http://thestackunderflow.com/. .

Seeking knowledge is an obligation upon every Muslim” (Sunan Ibn Majjah, 224)

Let’s start with the first set of slides 1 Basics OF Programming Let’s start with the first set of slides

Text Book Object Oriented Programming in c++ any updated Edition by Robert Lafore

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.

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];

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};

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};

#include <iostream> using namespace std; int main () { int n[ 3 ]={1,2,3}; cout<< n[1]; return 0; }

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.

char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'};

#include <iostream> using namespace std; int main () { char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'}; cout << "Greeting message: "; cout << greeting << endl; return 0; }

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.

#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; }