Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Pointers to Members - Advanced Programming - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Advanced Programming which includes Class Data Members, Class Data Initializers, Class Objects, Class Instructor, Constructor Initializer, User Defined Types, Appropriate Constructors, Class Declaration, Name of Base Class etc. Key important points are: Pointers to Members, Member Function Invocation, Return Pointer, Direct Reference to Members, Before Configuration, Pointers to Data Members, Pointers to Member Functions, Class Student

Typology: Slides

2012/2013

Uploaded on 03/21/2013

dharmaraaj
dharmaraaj 🇮🇳

4.4

(63)

150 documents

1 / 10

Toggle sidebar

Related documents


Partial preview of the text

Download Pointers to Members - Advanced Programming - Lecture Slides and more Slides Computer Science in PDF only on Docsity! Classes this & pointers to members Docsity.com Self-Reference -- this • A Pointer to the Object, which is Used in Member Function Invocation -- this • A Return Pointer to that Object • Direct Reference to Members of the Object in a Member Function is Possible • this is NOT Available to friend Functions Docsity.com this -- Example 2 • void student::append(student *ip){ ip->next = next; ip->prev = this; next->prev = ip; next = ip; } • void my_function(student *new_student){ student *head; // ... head->append(new_student); } Docsity.com this -- Example 2 head (this) ss3 prev next ss2 prev next ss1 prev next ss4 prev next ip Before configuration Docsity.com this -- Example 2 Head (this) ss3 prev next ss2 prev next ss1 prev next ss4 prev next ip After configuration void student::append(student *ip){ ip->next = next; ip->prev = this; next->prev = ip; next = ip; Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved