Kapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8

Size: px
Start display at page:

Download "Kapi ap l S e S hgal P T C p t u er. r S. c S ienc n e A n A k n leshw h ar ar Guj u arat C C h - 8"

Transcription

1 Chapter 8 Introduction C++ Memory Map Free Stores Declaration and Initialization of pointers Dynamic allocation operators Pointers and Arrays Pointers and Const Pointers and Function Pointer and Structures Object as function arguments Pointers and Object

2 Introduction of Pointers A pointer is a variable that holds a memory address, usually the location of another variable in memory. Three reasons for the pointers supports in C++ First, Pointers provides the means through which the memory location of a variable can be directly accessed. Second, Pointers supports C++ s dynamic allocation routines. Third, Pointers can improve the efficiency of certain routines. Warnings!!!!!!!!!!!! (Limitation) Un initialized or wild pointers can cause your system crash.

3 C++ Memory Map C++ creates four logically distinct regions of memory that are used for four distinct specific function. One region in the memory holds the compiled code of the program. Every instruction and every function of the program starts at a particular address. The next region is the memory area where the global variable of the program are stored. Global variable remain in the memory as long as program continues. Third region is known as stack, is used in great many things while your program execute. The stack is used for holding return address of the function calls. The Heap memory are is a region of free memory from which dynamic memory allocation function works.

4 Memory Map Global Variable 2. Stack 3 Heap 4 Program Code 1. Area used for function calls, return address, arguments and local variables. Area Used for dynamic allocation of memory

5 Dynamic and Static Allocation of Memory The Golden rule of computers states that, anything and every thing (data and instruction) that needs to be processed must be loaded into internal memory before its processing takes place. It means every data and instruction that is being executed must be allocated some are in the main memory. The Main memory is allocated in two ways. First is - Static Memory Allocation Second is Dynamic Memory Allocation.

6 Static Memory Allocation When an amount of memory to be allocated is known beforehand and the memory is allocated during compilation itself. It is referred as Static Memory Allocation. Ex--- int x; In this case computer knows that what the length of a int variable is, generally it is 2 bytes. So a chunk of 2 bytes internal memory will be allocated variable x during compilation itself. This is example of static memory allocation.

7 Dynamic Memory Allocation When the amount of memory to be allocated is not known beforehand as required during runtime itself, then the allocation of memory at run time is referred to a dynamic memory allocation. C++ offers two operators for dynamic memory allocation new and delete. The Operator new allocates the memory dynamically and return a pointer storing the memory address of the allocated memory. The operator delete de allocates the memory pointed by the given pointers. Free Store - Free Store is a pool of unallocated heap memory given to a program that is used by program for dynamic allocation during exection

8 Declaration & Initialization of Pointers Pointer variable are declared like other variable except for the addition of the unary * character. The general form of a pointer declaration is as follows type *var_name; Where type is any valid C++ data type and var-nameis the name of the pointer variable. Ex. int *iptr; char *name; float *i; Here all are pointer variable and can hold only address of concerned type; There are two special operator * and & are used with pointers. int i =25; // declares and initialize an int variable i; int *iptr; //declares the pointer variable iptr; iprt = &i; // Stores the memory address of I into iprt;

9 Working of & operator Address of i 1050 i 25 int i =25; int *iptr iptr 1050 iptr = &i; j 25 j = i & operator is used, when we want to access the address of any variables. We must put the & operator before the variable.

10 Working of * Operator &i i iptr j The second pointer operator, * does the reverse of &. The unary operator * return the value of of the variable located at the address following it.

11 Pointer Arithmetic Only two arithmetic operations addition and subtraction may be performed on pointers. When you add 1 to a pointer, you actually adding the size of whatever the pointer is pointing at. Each time a pointer is incremented by 1, it points to the memory location of the next element of the base type. Ex int *p; // Let currently pointed memory addess p++; // the next position p pointed at 1003 not for 1002, because size of int is 2 bytes. So it should increase by 2.; P+=3; // now p pointed at position ( =1009)

12 Dynamic Allocation Operators Dynamic allocation is the means by which a program can obtain memory during runtime. The Global and Local variables are allocated memory during compile-time. How ever you can not add any global or local variable during run-time. In such a case you would need to allocate memory during runtime, as and when needed. C++ defines two unary operators new and delete that perform the task of allocating and freeing memory at runtime. The new operator can be used to allocated memory. Ex.. pointer-variable = new data-type; Ex.. student *k; k = new student;

13 Continue. Once a pointer points to newly allocated memory data values can be stored there using the address operator (*). int *t; //declare an pointer to int variable; t = new int; // assing the memroy to *t variable *t=50; // assign the value to the memory of t; t 50 t 1054 Address of t 1051

14 Creating Dynamic Array The operator new can also allocate memory for user-defined types like structure, array and classes. To allocate memory for a one-dimensional array, new operator used as follows. pointer-variable = new data-type[size]; int *value = new int[10] ; // equivalent to - int value[10]; It will create an array value of 10 integer value. To allocate memory for two dimensional array new operator used as follows. int *val, r =10, c= 5; val = new int [r * c]; // create val 2 D array of 10 X 5;

15 Continue.. By Default operator new returns 0. when insufficient free store is available to satisfy its request. Ex int *val = new int; If (val) *val =7 ; else // if val is non-null or non-zero; cout<< Out of memory!! \n ; When an object, created through new is no longer needed, it must be destroyed so that the memory space occupied by it may be released for reuse. This can be done with the help of delete operator.

16 De Allocation of Memory delete operator can be used to de allocated memory. Ex.. delete pointer-variable; Ex.. student *k; k = new student delete k; The arrays allocated through new are freed using the following form of delete; delete [size] pointer-variable; Where size is the number of elements in the array being pointed to pointer variables. In recent version of C++, size in not required. delete []array-name; Ex.. int *t = new int[10]; delete [10]t; or delete []t;

17 Memory Leaks Once we allocate the memory to a pointer object but forget to de allocate it. This cause the memory block. A certain function that dynamically allocates memory to some object but forget to de allocate the reserved memory. This situation is known as memory leak. Many possible reasons for memory leak Forgetting to delete something that has earlier allocated new Failing to notice that code may bypass delete statement under certain circumstances. Assigning the result of a new statement to a pointer that was already pointing to an allocated objects. Warnings!!!!!!!!!!!!!!! Improper use of new and delete may lead to memory leaks.

18 Pointers and Arrays Array and Pointers are very closely linked. C++ treats the name of the array as it a pointer. C++ interprets the name of the array as the address of the first element of the arrays called the Base Address of Array. Base Address of the array can not be changed further. int *a; // a is a pointer to an int int age[5]; // age is an array holding 5 integer; cout<<"enter value for array age \n "; for(int i=0;i<5;i++) a=age; cout<<"\n a point to <<*a; cout<<"\n age point to <<"*age; } Let int age[5]={5,6,8,9,10}; Then the output of the program will be a point to 5 age point to 5

19 Array of Pointers Pointer also may be array type. To declare an array holding 10 int pointers, The declaration would be as follows. int *cs[10]; After the declaration contiguous memory would be allocated for 10 pointers 205 Now each of the pointers, the element of pointer array may be initialized. To assign the address of an integer variable amt to the forth element of the pointer array. We will write cs[3]=&amt; amt 205

20 int *cs[5] Array cs address int a = 10, b = 23, c = 40, k = 25, r = 6; a b c k r ` cs[0]=&a; cs[1]=&b; cs[2]=&c, cs[3]=&k; cs[4]=&r; now cs is 0 1` Array cs address

21 Pointers and String We know that C++ treats a string as an array of characters,. A string is one dimensional array of characters terminated by a null \0 characters. Ex.. char name[]= Pointers ; // declares a string; For (int i=0;i!= \0 ;i++) cout<<name[i]; Alternatively the same will achieve using the pointers also; char name[]= Pointers ; // declares a string; char *cp For (cp=name; cp!= \0 ;cp++) cout<<*cp;

22 Array of Char Pointers An array of char pointer is very popularly used for storing several strings in memory. Ex char *name[] = { Sachin, Ram, Kumar, Sunil, Anil }; In the above declaration name is an array of char pointer whose element pointers contains base addresses of respective names. Here the element name[0] contains the base address of string Sachin, similarly name[1] contains the base address of string Ram and so on. The array of pointers makes more efficient use of available memory. An array of pointers makes the manipulation of the string much easier.

23 Array of pointers pointing several strings S a c h i n \0 R a m \0 K u m a r \0 S u n i l \0 A n i l \0 Name [] Now what will the output of the following lines char *cp; cp=name[3]; cout<<*cp<<*(cp+2)<<*++cp Output Snu

24 Pointers And Const A constant pointer means that the pointer in consideration will always point to the same address. Its address can not be modified In the following lines We shall declare four variables. (1) a pointer call ptr (2) a constant pointer called cptr (3) a pointer named ptrc pointing to constant (4) a constant pointer cprc pointing to constant. int a = 64; // an int int *ptr = &n // a pointer to an int ++(*ptr) // increment to *prt; int *const cptr = &n // a const pointer to an int ++(*cptr); // increment to *cptr ++cptr; // error // constant pointer can not change their address const int kn = 88; // a const int const int *ptrc = &kn; // a pointer to const int ++(*ptrc) // error content cannot be modify ++ptrc; // increment pointer ptrc const int *const cptrc = &kn; // a const pointer to const int ++(*cptrc); // error ++cptrc; //error

25 Pointers and Function A Function is user defined operation that can be invoked by applying the call operator ( ( ) ) to the function s name. If the function expects to receive arguments, these arguments (actual arguments) are placed inside the call operator. The arguments are separated by comma. A function may be invoked in two ways (1) Call by value (2) Call by reference The second method can itself be used in two ways. (1) By passing the reference (2) By passing the pointers A reference is an alias name for a variable, the following code float value = ; float &amt = value; Here amt and value refer the same location of the memory, if the one have change their value the other also got change their values.

26 Invoking function by passing the reference When parameters are passed to the function by reference, then the formal parameters become reference to the actual parameters in the calling funtion. The call by reference method is useful in situation when the values of the original variables are to be changed using a function. float value = ; float *fp = &values ; float &amt = value; Here all the following print the same value ; cout<<value; cout<<*fp; cout<<amt;

27 Swap Call by reference #include<iostream.h> #include<conio.h> void swap(int &a, int &b) { int t; // a=a+b; t=a; // b=a-b; a=b; // a=a-b; b-t; } void main() { int x,y; clsrcr(); cout<<endl<<"enter two values "; cin>>x>>y; cout<<"\n Before Swap \n "; cout<<" x = "<<x<<" y = "<<y; swap(x,y); cout<<"\n After Swap \n "; cout<<" x = "<<x<<" y = "<<y; getch(); } Swap Call by pointers #include<iostream.h> #include<conio.h> void swap(int *a, int *b) { int t; // a=a+b; t=*a; // b=a-b; *a=*b; // a=a-b; *b-t; } void main() { int x,y; clsrcr(); cout<<endl<<"enter two values "; cin>>x>>y; cout<<"\n Before Swap \n "; cout<<" x = "<<x<<" y = "<<y; swap(&x,&y); cout<<"\n After Swap \n "; cout<<" x = "<<x<<" y = "<<y; getch(); }

28 Function Returning Pointers The way a function can returns an int, a float, a double or reference or any other data types. It can even returns a pointers. However function declaration must replace it. Syntax type *function_name ( argument list); Here the type may be any type. #include<iostream.h> #include<conio.h> int *big(int &x, int &y) { if (x>y) return (&x); else return(&y); } void main() { int a,b,*g; clrscr(); cout<<"enter two no "; cin>>a>>b; g=big(a,b); cout<<"\n Big Number is "<<*g; getch(); }

29 Pointer And Structure C++ allows pointers to structures just as it allows pointers to int or float or any other data type. Declaration and Use. struct-name *structure-pointer Where struct-name is the already declare struct name and structure-pointer is the struct pointer variable. Ex. struct date { int dd,mm,yy; }; struct date *ptrdate;

30 Continue. Using structure pointer, the member of structure are accessed using the -> operator. It can be written as struct-pointer->struct-member; As the above example. ptrdate->dd, ptrdate->mm, ptrdate->yy; There are two primary uses for structure pointers 1. To generate a call by reference call to a function 2. To create dynamic data structure like linked list, stack, queues, trees etc. Using C++ dynamic allocation system.

31 Self Referential Structure A structure having a member element that refers to the structure itself is known as self-referential structure. Empno Name Amar Anuj Sheeba Basic Experience Next

32 Dynamic Structure The new operator is used to create dynamic structure the structure for the memory is allocated dynamically. SYNTAX. Struct-pointer = new struct type; Ex.. employee *ptr; ptr = new employee; This dynamic structure is released by the de allocation operator delete. delete ptr;

33 Object as a function Arguments Object are passed to function in the same way as any other type of variable is passed. This means object may be passed both ways - through call by value and through call by reference Passing Object through call by value.--- In this way the called function creates a copy of the passed object. However the fact that a copy is created. Here two questions generated (1) Is the object s constructor executed when the copy of the passed object is made. (2) Is the destructor executed when the copy is destroyed. What are the solutions of these problems?

34 #include<iostream.h> class sample { int x; public: sample(int i) { x = i; cout<< "Constructing object with "<<x<<"\n"; } ~sample() { cout<< "Destroying object having "<<x<<"\n"; } void put_x(int i) { x = i ; } int get_x() { return x; } }; void func(sample s1) { s1.put_x(2); cout<<" This is x local to fun() \n "; cout<<"x = "<<s1.get_x()<<"\n"; } void main() { sample s(1); cout<<" This is the main () "; cout<" x = "<<s.get_x()<<"\n"; func(s); cout<< "Back is Main () \n "; cout<<"x = "<<s.get_x()<<"\n"; } Output This is the main() x = 1 This is x local to func() x = 2 Destroying object having 2 Back in main() x = 1 Destroying object having 1

35 Passing object through References We know that when an object is passed by value to a function a copy of that object is made without invoking its constructor. However when function terminates the copy s destructor is called. If you want to called function to work with the original object so that there is no need to create and destroy the copy of it, You may pass the reference of the object, then called function refers the original object.

36 #include<iostream.h> class sample { int x; public: sample(int i) { x = i; cout<< "Constructing object with "<<x<<"\n"; } ~sample() { cout<< "Destroying object having "<<x<<"\n"; } void put_x(int i) { x = i ; } int get_x() { return x; } }; void func(sample &s1) { s1.put_x(2); cout<<" This is x local to fun() \n "; cout<<"x = "<<s1.get_x()<<"\n"; } void main() { sample s(1); cout<<" This is the main () "; cout<" x = "<<s.get_x()<<"\n"; func(s); cout<< "Back is Main () \n "; cout<<"x = "<<s.get_x()<<"\n"; } Output This is the main() x = 1 This is x local to func() x = 2 Destroying object having 2 Back in main() x = 2 Destroying object having 1

37 Pointers And Objects Just like other pointers, the object pointer are declared by placing in front of a object pointer s name. Its form as follows class-name *object-name; Where class-name is the name of an already defined class and object pointer is the pointer to an object of this class type. student *k; Here student is the class name and k is the pointer type object. When accessing members of the class using object pointer, the arrow (->) operator is used instead of dot (.) operator.

38 Ex.. #include<iostream.h> class time { int hh,mm,sss; public: time() { hh=mm=ss=0;} void readdata() {... } void printdata() {... } }; void main() { time t, *pt; t.readdata()' t.printdata(); pt = &t; pt->printdata(); }

39 this pointer Whenever you define a class, the member function are created and placed in the memory space only once. It means only one copy of member functions is manipulated that is shared by all the objects of the class. Now there is a problem? If only one instance of a member function exist, how does it come to know which object s data member is to be manipulated? The solution of this problem is this pointer, when a member function is called, it is automatically passed an implicit argument that is the pointer of the object that invoked the member function. This pointer is called this. EX. In a bank there are many accounts. The account holder can withdraw amount or view their bank balance through ATM (Automatic Teller Machine). Now ATMs can withdraw from any account in the bank, but which account are they supposed to work upon? This is resolved by the ATM card. By card account number is passed implicitly to the machine.

40 #include<iostream.h> #include<conio.h> #include<string.h> class salesman { char name[25]; float tsales; public: salesman(char *sn,float amt) { strcpy(name,""); strcpy(name,sn); tsales=amt; } void printobject() { cout<<this->name; cout<<" has inovoked printobject \n"; } }; void main() { salesman raman("raman",4500),ved("ved",5 000),vedant("Vedant",6000); clrscr(); raman.printobject(); ved.printobject(); vedant.printobject(); getch(); } OUTPUT Raman has inovoked printobject Ved has inovoked printobject Vedant has inovoked printobject

What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable.

What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable. CHAPTER 08 POINTERS What is Pointer? Pointer is a variable that holds a memory address, usually location of another variable. The Pointers are one of the C++ s most useful and powerful features. How Pointers

More information

POINTERS - Pointer is a variable that holds a memory address of another variable of same type. - It supports dynamic allocation routines. - It can improve the efficiency of certain routines. C++ Memory

More information

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer: Chapter-11 POINTERS Introduction: Pointers are a powerful concept in C++ and have the following advantages. i. It is possible to write efficient programs. ii. Memory is utilized properly. iii. Dynamically

More information

MEMORY ADDRESS _ REPRESENTATION OF BYTES AND ITS ADDRESSES

MEMORY ADDRESS _ REPRESENTATION OF BYTES AND ITS ADDRESSES [1] ~~~~~~~~~~~~~~~~~ POINTER A pointers is a variable that holds a memory address, usually the location of another variable in memory. IMPORTANT FEATURES OF POINTERS (1) provide the means through which

More information

POINTERS INTRODUCTION: A pointer is a variable that holds (or whose value is) the memory address of another variable and provides an indirect way of accessing data in memory. The main memory (RAM) of computer

More information

Lecture 14. No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions?

Lecture 14. No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions? Lecture 14 No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions? Friday, February 11 CS 215 Fundamentals of Programming II - Lecture 14 1 Outline Static

More information

Solution: A pointer is a variable that holds the address of another object (data item) rather than a value.

Solution: A pointer is a variable that holds the address of another object (data item) rather than a value. 1. What is a pointer? A pointer is a variable that holds the address of another object (data item) rather than a value. 2. What is base address? The address of the nth element can be represented as (a+n-1)

More information

[0569] p 0318 garbage

[0569] p 0318 garbage A Pointer is a variable which contains the address of another variable. Declaration syntax: Pointer_type *pointer_name; This declaration will create a pointer of the pointer_name which will point to the

More information

C++ for Java Programmers

C++ for Java Programmers Basics all Finished! Everything we have covered so far: Lecture 5 Operators Variables Arrays Null Terminated Strings Structs Functions 1 2 45 mins of pure fun Introduction Today: Pointers Pointers Even

More information

DECLARAING AND INITIALIZING POINTERS

DECLARAING AND INITIALIZING POINTERS DECLARAING AND INITIALIZING POINTERS Passing arguments Call by Address Introduction to Pointers Within the computer s memory, every stored data item occupies one or more contiguous memory cells (i.e.,

More information

CS201 Some Important Definitions

CS201 Some Important Definitions CS201 Some Important Definitions For Viva Preparation 1. What is a program? A program is a precise sequence of steps to solve a particular problem. 2. What is a class? We write a C++ program using data

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Classes Chapter 4 Classes and Objects Data Hiding and Encapsulation Function in a Class Using Objects Static Class members Classes Class represents a group of Similar objects A class is a way to bind the

More information

CHAPTER 4 FUNCTIONS. 4.1 Introduction

CHAPTER 4 FUNCTIONS. 4.1 Introduction CHAPTER 4 FUNCTIONS 4.1 Introduction Functions are the building blocks of C++ programs. Functions are also the executable segments in a program. The starting point for the execution of a program is main

More information

Downloaded from

Downloaded from Unit I Chapter -1 PROGRAMMING IN C++ Review: C++ covered in C++ Q1. What are the limitations of Procedural Programming? Ans. Limitation of Procedural Programming Paradigm 1. Emphasis on algorithm rather

More information

Pointers. Introduction

Pointers. Introduction Pointers Spring Semester 2007 Programming and Data Structure 1 Introduction A pointer is a variable that represents the location (rather than the value) of a data item. They have a number of useful applications.

More information

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples:

Data type of a pointer must be same as the data type of the variable to which the pointer variable is pointing. Here are a few examples: Unit IV Pointers and Polymorphism in C++ Concepts of Pointer: A pointer is a variable that holds a memory address of another variable where a value lives. A pointer is declared using the * operator before

More information

OOP THROUGH C++(R16) int *x; float *f; char *c;

OOP THROUGH C++(R16) int *x; float *f; char *c; What is pointer and how to declare it? Write the features of pointers? A pointer is a memory variable that stores the address of another variable. Pointer can have any name that is legal for other variables,

More information

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED.

THE NAME OF THE CONSTRUCTOR AND DESTRUCTOR(HAVING (~) BEFORE ITS NAME) FUNCTION MUST BE SAME AS THE NAME OF THE CLASS IN WHICH THEY ARE DECLARED. Constructor and Destructor Member Functions Constructor: - Constructor function gets invoked automatically when an object of a class is constructed (declared). Destructor:- A destructor is a automatically

More information

Chapter-13 USER DEFINED FUNCTIONS

Chapter-13 USER DEFINED FUNCTIONS Chapter-13 USER DEFINED FUNCTIONS Definition: User-defined function is a function defined by the user to solve his/her problem. Such a function can be called (or invoked) from anywhere and any number of

More information

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C CS2351 Data Structures Lecture 7: A Brief Review of Pointers in C 1 About this lecture Pointer is a useful object that allows us to access different places in our memory We will review the basic use of

More information

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor. 3.Constructors and Destructors Develop cpp program to implement constructor and destructor. Constructors A constructor is a special member function whose task is to initialize the objects of its class.

More information

Pointer Basics. Lecture 13 COP 3014 Spring March 28, 2018

Pointer Basics. Lecture 13 COP 3014 Spring March 28, 2018 Pointer Basics Lecture 13 COP 3014 Spring 2018 March 28, 2018 What is a Pointer? A pointer is a variable that stores a memory address. Pointers are used to store the addresses of other variables or memory

More information

CS201- Introduction to Programming Current Quizzes

CS201- Introduction to Programming Current Quizzes CS201- Introduction to Programming Current Quizzes Q.1 char name [] = Hello World ; In the above statement, a memory of characters will be allocated 13 11 12 (Ans) Q.2 A function is a block of statements

More information

Downloaded S. from Kiran, PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from

Downloaded S. from Kiran,  PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from Downloaded S. from Kiran, www.studiestoday.com PGT (CS) KV, STRUCTURES WHAT IS A STRUCTURE? Structure is a collection of logically related data. It is also a collection of dissimilar datatype. Downloaded

More information

Sample Paper Class XI Subject Computer Sience UNIT TEST II

Sample Paper Class XI Subject Computer Sience UNIT TEST II Sample Paper Class XI Subject Computer Sience UNIT TEST II (General OOP concept, Getting Started With C++, Data Handling and Programming Paradigm) TIME: 1.30 Hrs Max Marks: 40 ALL QUESTIONS ARE COMPULSURY.

More information

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example:

POINTERS. Pointer is a memory variable which can store address of an object of specified data type. For example: POINTERS Pointer is a memory variable which can store address of an object of specified data type For example: #include int x=5; int *a;//here a is a pointer to int which can store address of

More information

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018 CS 31: Intro to Systems Pointers and Memory Kevin Webb Swarthmore College October 2, 2018 Overview How to reference the location of a variable in memory Where variables are placed in memory How to make

More information

CSE202-Lec#4. CSE202 C++ Programming

CSE202-Lec#4. CSE202 C++ Programming CSE202-Lec#4 Functions and input/output streams @LPU CSE202 C++ Programming Outline Creating User Defined Functions Functions With Default Arguments Inline Functions @LPU CSE202 C++ Programming What is

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CE221 Programming in C++ Part 2 References and Pointers, Arrays and Strings

CE221 Programming in C++ Part 2 References and Pointers, Arrays and Strings CE221 Programming in C++ Part 2 References and Pointers, Arrays and Strings 19/10/2017 CE221 Part 2 1 Variables and References 1 In Java a variable of primitive type is associated with a memory location

More information

Exam 3 Chapters 7 & 9

Exam 3 Chapters 7 & 9 Exam 3 Chapters 7 & 9 CSC 2100-002/003 29 Mar 2017 Read through the entire test first BEFORE starting Put your name at the TOP of every page The test has 4 sections worth a total of 100 points o True/False

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Scott Gibson. Pointers & Dynamic Memory. Pre & Co Requisites. Random Access Memory. Data Types. Atomic Type Sizes

Scott Gibson. Pointers & Dynamic Memory. Pre & Co Requisites. Random Access Memory. Data Types. Atomic Type Sizes Scott Gibson Pointers & Dynamic Memory Lecture #1 Office: LAH 103 Email: sgibson@brookdalecc.edu sgib@optonline.net Web: www.brookdalecc.edu/fac/cos/sgibson Phone: (732) 224 2285 1 2 Pre & Co Requisites

More information

Pointers. A pointer value is the address of the first byte of the pointed object in the memory. A pointer does not know how many bytes it points to.

Pointers. A pointer value is the address of the first byte of the pointed object in the memory. A pointer does not know how many bytes it points to. Pointers A pointer is a memory address of an object of a specified type, or it is a variable which keeps such an address. Pointer properties: P (pointer) 12316 12316 (address) Typed object A pointer value

More information

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet

BRAIN INTERNATIONAL SCHOOL. Term-I Class XI Sub: Computer Science Revision Worksheet BRAIN INTERNATIONAL SCHOOL Term-I Class XI 2018-19 Sub: Computer Science Revision Worksheet Chapter-1. Computer Overview 1. Which electronic device invention brought revolution in earlier computers? 2.

More information

UEE1302 (1102) F10 Introduction to Computers and Programming (I)

UEE1302 (1102) F10 Introduction to Computers and Programming (I) Computational Intelligence on Automation Lab @ NCTU UEE1302 (1102) F10 Introduction to Computers and Programming (I) Programming Lecture 10 Pointers & Dynamic Arrays (I) Learning Objectives Pointers Data

More information

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016 CS 31: Intro to Systems Pointers and Memory Martin Gagne Swarthmore College February 16, 2016 So we declared a pointer How do we make it point to something? 1. Assign it the address of an existing variable

More information

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW IMPORTANT QUESTIONS IN C FOR THE INTERVIEW 1. What is a header file? Header file is a simple text file which contains prototypes of all in-built functions, predefined variables and symbolic constants.

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

Functions. Introduction :

Functions. Introduction : Functions Introduction : To develop a large program effectively, it is divided into smaller pieces or modules called as functions. A function is defined by one or more statements to perform a task. In

More information

Pointer Data Type and Pointer Variables

Pointer Data Type and Pointer Variables Pointer Data Type and Pointer Variables Pointer variable: content is a memory address There is no name associated with the pointer data type in C++. Declaring Pointer Variables Syntax: Data-type *identifier

More information

C++ 8. Constructors and Destructors

C++ 8. Constructors and Destructors 8. Constructors and Destructors C++ 1. When an instance of a class comes into scope, the function that executed is. a) Destructors b) Constructors c) Inline d) Friend 2. When a class object goes out of

More information

CS558 Programming Languages Winter 2018 Lecture 4a. Andrew Tolmach Portland State University

CS558 Programming Languages Winter 2018 Lecture 4a. Andrew Tolmach Portland State University CS558 Programming Languages Winter 2018 Lecture 4a Andrew Tolmach Portland State University 1994-2018 Pragmatics of Large Values Real machines are very efficient at handling word-size chunks of data (e.g.

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 4a Andrew Tolmach Portland State University 1994-2016 Pragmatics of Large Values Real machines are very efficient at handling word-size chunks of data (e.g.

More information

Pointers and Dynamic Memory Allocation

Pointers and Dynamic Memory Allocation Pointers and Dynamic Memory Allocation ALGORITHMS & DATA STRUCTURES 9 TH SEPTEMBER 2014 Last week Introduction This is not a course about programming: It s is about puzzling. well.. Donald Knuth Science

More information

Lecture 2: C Programm

Lecture 2: C Programm 0 3 E CS 1 Lecture 2: C Programm ing C Programming Procedural thought process No built in object abstractions data separate from methods/functions Low memory overhead compared to Java No overhead of classes

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

Object-Oriented Principles and Practice / C++

Object-Oriented Principles and Practice / C++ Object-Oriented Principles and Practice / C++ Alice E. Fischer September 26, 2016 OOPP / C++ Lecture 4... 1/33 Global vs. Class Static Parameters Move Semantics OOPP / C++ Lecture 4... 2/33 Global Functions

More information

CS31 Discussion 1E Spring 17 : week 08

CS31 Discussion 1E Spring 17 : week 08 CS31 Discussion 1E Spring 17 : week 08 TA: Bo-Jhang Ho bojhang@cs.ucla.edu Credit to former TA Chelsea Ju Project 5 - Map cipher to crib Approach 1: For each pair of positions, check two letters in cipher

More information

Programming Studio #9 ECE 190

Programming Studio #9 ECE 190 Programming Studio #9 ECE 190 Programming Studio #9 Concepts: Functions review 2D Arrays GDB Announcements EXAM 3 CONFLICT REQUESTS, ON COMPASS, DUE THIS MONDAY 5PM. NO EXTENSIONS, NO EXCEPTIONS. Functions

More information

Discussion 1E. Jie(Jay) Wang Week 10 Dec.2

Discussion 1E. Jie(Jay) Wang Week 10 Dec.2 Discussion 1E Jie(Jay) Wang Week 10 Dec.2 Outline Dynamic memory allocation Class Final Review Dynamic Allocation of Memory Recall int len = 100; double arr[len]; // error! What if I need to compute the

More information

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak

OBJECT ORIENTED PROGRAMMING. Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PROGRAMMING Ms. Ajeta Nandal C.R.Polytechnic,Rohtak OBJECT ORIENTED PARADIGM Object 2 Object 1 Data Data Function Function Object 3 Data Function 2 WHAT IS A MODEL? A model is an abstraction

More information

Lecture 4: Outline. Arrays. I. Pointers II. III. Pointer arithmetic IV. Strings

Lecture 4: Outline. Arrays. I. Pointers II. III. Pointer arithmetic IV. Strings Lecture 4: Outline I. Pointers A. Accessing data objects using pointers B. Type casting with pointers C. Difference with Java references D. Pointer pitfalls E. Use case II. Arrays A. Representation in

More information

First of all, it is a variable, just like other variables you studied

First of all, it is a variable, just like other variables you studied Pointers: Basics What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the address (rather than the value)

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 11: Structures and Memory (yaseminb@kth.se) Overview Overview Lecture 11: Structures and Memory Structures Continued Memory Allocation Lecture 11: Structures and Memory Structures Continued Memory

More information

FORM 1 (Please put your name and section number (001/10am or 002/2pm) on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each):

FORM 1 (Please put your name and section number (001/10am or 002/2pm) on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each): FORM 1 (Please put your name and section number (001/10am or 002/2pm) on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each): 1. If a function has default arguments, they can be located anywhere

More information

Lecture 2, September 4

Lecture 2, September 4 Lecture 2, September 4 Intro to C/C++ Instructor: Prashant Shenoy, TA: Shashi Singh 1 Introduction C++ is an object-oriented language and is one of the most frequently used languages for development due

More information

Pointers, Dynamic Data, and Reference Types

Pointers, Dynamic Data, and Reference Types Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation The new operator The delete operator Dynamic Memory Allocation for Arrays 1 C++ Data Types simple

More information

Pointers and References

Pointers and References Steven Zeil October 2, 2013 Contents 1 References 2 2 Pointers 8 21 Working with Pointers 8 211 Memory and C++ Programs 11 212 Allocating Data 15 22 Pointers Can Be Dangerous 17 3 The Secret World of Pointers

More information

Darshan Institute of Engineering & Technology for Diploma Studies

Darshan Institute of Engineering & Technology for Diploma Studies 1. Explain Call by Value vs. Call by Reference Or Write a program to interchange (swap) value of two variables. Call By Value In call by value pass value, when we call the function. And copy this value

More information

Pointers Pointer Variables. Pointer Variables Getting the Address of a Variable. Each variable in program is stored at a

Pointers Pointer Variables. Pointer Variables Getting the Address of a Variable. Each variable in program is stored at a 3.1. Getting the Address of a Variable Pointers (read Chapter 9. Starting Out with C++: From Control Structures through Objects, Tony Gaddis.) Le Thanh Huong School of Information and Communication Technology

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

INITIALISING POINTER VARIABLES; DYNAMIC VARIABLES; OPERATIONS ON POINTERS

INITIALISING POINTER VARIABLES; DYNAMIC VARIABLES; OPERATIONS ON POINTERS INITIALISING POINTER VARIABLES; DYNAMIC VARIABLES; OPERATIONS ON POINTERS Pages 792 to 800 Anna Rakitianskaia, University of Pretoria INITIALISING POINTER VARIABLES Pointer variables are declared by putting

More information

C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different.

C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different. C++ Character Set a-z, A-Z, 0-9, and underscore ( _ ) C++ is case sensitive language, meaning that the variable first_value, First_Value or FIRST_VALUE will be treated as different. Identifier and Keywords:

More information

Pointers II. Class 31

Pointers II. Class 31 Pointers II Class 31 Compile Time all of the variables we have seen so far have been declared at compile time they are written into the program code you can see by looking at the program how many variables

More information

Classes: Member functions // classes example #include <iostream> using namespace std; Objects : Reminder. Member functions: Methods.

Classes: Member functions // classes example #include <iostream> using namespace std; Objects : Reminder. Member functions: Methods. Classes: Methods, Constructors, Destructors and Assignment For : COP 3330. Object oriented Programming (Using C++) http://www.compgeom.com/~piyush/teach/3330 Piyush Kumar Classes: Member functions // classes

More information

CS 2461: Computer Architecture I

CS 2461: Computer Architecture I Next: Pointers, Arrays, Structs... : Computer Architecture I The real fun stuff in C.. Pointers and Arrays Read Chapters 16, 18 of text Functions, Arrays, Pointers Dynamic data structures Allocating space

More information

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 1 OPERATOR OVERLOADING KOM3191 Object-Oriented Programming KOM3191 Object Oriented Programming Dr Muharrem Mercimek 2 Dynamic Memory Management

More information

CSC1322 Object-Oriented Programming Concepts

CSC1322 Object-Oriented Programming Concepts CSC1322 Object-Oriented Programming Concepts Instructor: Yukong Zhang February 18, 2016 Fundamental Concepts: The following is a summary of the fundamental concepts of object-oriented programming in C++.

More information

PIC 10A Pointers, Arrays, and Dynamic Memory Allocation. Ernest Ryu UCLA Mathematics

PIC 10A Pointers, Arrays, and Dynamic Memory Allocation. Ernest Ryu UCLA Mathematics PIC 10A Pointers, Arrays, and Dynamic Memory Allocation Ernest Ryu UCLA Mathematics Pointers A variable is stored somewhere in memory. The address-of operator & returns the memory address of the variable.

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

04-19 Discussion Notes

04-19 Discussion Notes 04-19 Discussion Notes PIC 10B Spring 2018 1 Constructors and Destructors 1.1 Copy Constructor The copy constructor should copy data. However, it s not this simple, and we need to make a distinction here

More information

CS 101: Computer Programming and Utilization

CS 101: Computer Programming and Utilization CS 101: Computer Programming and Utilization Jul-Nov 2017 Umesh Bellur (cs101@cse.iitb.ac.in) Lecture 16: Representing variable length entities (introducing new and delete) A programming problem Design

More information

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size];

Computer Programming. C Array is a collection of data belongings to the same data type. data_type array_name[array_size]; Arrays An array is a collection of two or more adjacent memory cells, called array elements. Array is derived data type that is used to represent collection of data items. C Array is a collection of data

More information

Algorithms & Data Structures

Algorithms & Data Structures GATE- 2016-17 Postal Correspondence 1 Algorithms & Data Structures Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key

More information

Section - Computer Science. int main() {! int a=10,b=20;! printf("a:%d B:%d\n",a,b);! a=(a+b)-(b=a);! printf("a:%d B:%d\n",a,b);!

Section - Computer Science. int main() {! int a=10,b=20;! printf(a:%d B:%d\n,a,b);! a=(a+b)-(b=a);! printf(a:%d B:%d\n,a,b);! Section - Computer Science 1. What will be the output of the following piece of code? int! int a=10,b=20;! printf("a:%d B:%d\n",a,b);! a=(a+b)-(b=a);! printf("a:%d B:%d\n",a,b);! return 1; (i) A: 10, B:

More information

PROGRAMMING IN C++ COURSE CONTENT

PROGRAMMING IN C++ COURSE CONTENT PROGRAMMING IN C++ 1 COURSE CONTENT UNIT I PRINCIPLES OF OBJECT ORIENTED PROGRAMMING 2 1.1 Procedure oriented Programming 1.2 Object oriented programming paradigm 1.3 Basic concepts of Object Oriented

More information

Why Pointers. Pointers. Pointer Declaration. Two Pointer Operators. What Are Pointers? Memory address POINTERVariable Contents ...

Why Pointers. Pointers. Pointer Declaration. Two Pointer Operators. What Are Pointers? Memory address POINTERVariable Contents ... Why Pointers Pointers They provide the means by which functions can modify arguments in the calling function. They support dynamic memory allocation. They provide support for dynamic data structures, such

More information

a data type is Types

a data type is Types Pointers Class 2 a data type is Types Types a data type is a set of values a set of operations defined on those values in C++ (and most languages) there are two flavors of types primitive or fundamental

More information

Structured Data. CIS 15 : Spring 2007

Structured Data. CIS 15 : Spring 2007 Structured Data CIS 15 : Spring 2007 Functionalia HW4 Part A due this SUNDAY April 1st: 11:59pm Reminder: I do NOT accept LATE HOMEWORK. Today: Dynamic Memory Allocation Allocating Arrays Returning Pointers

More information

REFERENCES, POINTERS AND STRUCTS

REFERENCES, POINTERS AND STRUCTS REFERENCES, POINTERS AND STRUCTS Problem Solving with Computers-I https://ucsb-cs16-sp17.github.io/ Pointer assignment 2 int *p1, *p2, x; p1 = &x; p2 = p1; Q: Which of the following pointer diagrams best

More information

Computer Programming Unit 3

Computer Programming Unit 3 POINTERS INTRODUCTION Pointers are important in c-language. Some tasks are performed more easily with pointers such as dynamic memory allocation, cannot be performed without using pointers. So it s very

More information

nptr = new int; // assigns valid address_of_int value to nptr std::cin >> n; // assigns valid int value to n

nptr = new int; // assigns valid address_of_int value to nptr std::cin >> n; // assigns valid int value to n Static and Dynamic Memory Allocation In this chapter we review the concepts of array and pointer and the use of the bracket operator for both arrays and pointers. We also review (or introduce) pointer

More information

Dynamic Memory Allocation

Dynamic Memory Allocation Dynamic Memory Allocation The process of allocating memory at run time is known as dynamic memory allocation. C does not Inherently have this facility, there are four library routines known as memory management

More information

Pointers. 1 Background. 1.1 Variables and Memory. 1.2 Motivating Pointers Massachusetts Institute of Technology

Pointers. 1 Background. 1.1 Variables and Memory. 1.2 Motivating Pointers Massachusetts Institute of Technology Introduction to C++ Massachusetts Institute of Technology ocw.mit.edu 6.096 Pointers 1 Background 1.1 Variables and Memory When you declare a variable, the computer associates the variable name with a

More information

CS201 Latest Solved MCQs

CS201 Latest Solved MCQs Quiz Start Time: 09:34 PM Time Left 82 sec(s) Question # 1 of 10 ( Start time: 09:34:54 PM ) Total Marks: 1 While developing a program; should we think about the user interface? //handouts main reusability

More information

Pointers review. int a = 5; int *ptr = &a; cout << *ptr;

Pointers review. int a = 5; int *ptr = &a; cout << *ptr; Pointers review Let a variable aa be defined as int *aa;, what is stored in aa? Let a variable aa be defined as int ** aa; what is stored in aa? Why we should NOT return a pointer to a local variable?

More information

cout<< \n Enter values for a and b... ; cin>>a>>b;

cout<< \n Enter values for a and b... ; cin>>a>>b; CHAPTER 8 CONSTRUCTORS AND DESTRUCTORS 8.1 Introduction When an instance of a class comes into scope, a special function called the constructor gets executed. The constructor function initializes the class

More information

Lecture 3: C Programm

Lecture 3: C Programm 0 3 E CS 1 Lecture 3: C Programm ing Reading Quiz Note the intimidating red border! 2 A variable is: A. an area in memory that is reserved at run time to hold a value of particular type B. an area in memory

More information

CA31-1K DIS. Pointers. TA: You Lu

CA31-1K DIS. Pointers. TA: You Lu CA31-1K DIS Pointers TA: You Lu Pointers Recall that while we think of variables by their names like: int numbers; Computer likes to think of variables by their memory address: 0012FED4 A pointer is a

More information

CS 11 C track: lecture 5

CS 11 C track: lecture 5 CS 11 C track: lecture 5 Last week: pointers This week: Pointer arithmetic Arrays and pointers Dynamic memory allocation The stack and the heap Pointers (from last week) Address: location where data stored

More information

Intermediate Programming, Spring 2017*

Intermediate Programming, Spring 2017* 600.120 Intermediate Programming, Spring 2017* Misha Kazhdan *Much of the code in these examples is not commented because it would otherwise not fit on the slides. This is bad coding practice in general

More information

COMPUTER SCIENCE (083)

COMPUTER SCIENCE (083) Roll No. Code : 112011-083-A Please check that this question paper contains 7 questions and 6 printed pages. CLASS-XI COMPUTER SCIENCE (083) Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions

More information

Language comparison. C has pointers. Java has references. C++ has pointers and references

Language comparison. C has pointers. Java has references. C++ has pointers and references Pointers CSE 2451 Language comparison C has pointers Java has references C++ has pointers and references Pointers Values of variables are stored in memory, at a particular location A location is identified

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Chapter 6 Inheritance Extending a Class Chapter 6 Inheritance Extending a Class Introduction; Need for Inheritance; Different form of Inheritance; Derived and Base Classes; Inheritance and Access control; Multiple Inheritance Revisited; Multilevel

More information

! The address operator (&) returns the address of a. ! Pointer: a variable that stores the address of another

! The address operator (&) returns the address of a. ! Pointer: a variable that stores the address of another Week 4 Pointers & Structs Gaddis: Chapters 9, 11 CS 5301 Spring 2015 Jill Seaman 1 Pointers and Addresses! The address operator (&) returns the address of a variable. int x; cout

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Homework #3 CS2255 Fall 2012

Homework #3 CS2255 Fall 2012 Homework #3 CS2255 Fall 2012 MULTIPLE CHOICE 1. The, also known as the address operator, returns the memory address of a variable. a. asterisk ( * ) b. ampersand ( & ) c. percent sign (%) d. exclamation

More information

Pointers and Arrays 1

Pointers and Arrays 1 Pointers and Arrays 1 Pointers and Arrays When an array is declared, The compiler allocates sufficient amount of storage to contain all the elements of the array in contiguous memory locations The base

More information

SYSC 2006 C Winter 2012

SYSC 2006 C Winter 2012 SYSC 2006 C Winter 2012 Pointers and Arrays Copyright D. Bailey, Systems and Computer Engineering, Carleton University updated Sept. 21, 2011, Oct.18, 2011,Oct. 28, 2011, Feb. 25, 2011 Memory Organization

More information