Private member functions, C/C++ Programming

Private Member Functions:

A private member functions can be called by the members of the same class.  Consider the following example.

 

class sample

{ int number;

float cost;

void read(void);

public:

void update(void);

void display(void);

};

 

sample p; Constructing a object of class sample.

p.read( ); This is a invalid statement the private member cannot be accessed outside the class.  However this is a valid statement because the read is in the same class sample.

void sample : : update(void)

{read ( );

}

Posted Date: 9/20/2012 7:53:40 AM | Location : United States







Related Discussions:- Private member functions, Assignment Help, Ask Question on Private member functions, Get Answer, Expert's Help, Private member functions Discussions

Write discussion on Private member functions
Your posts are moderated
Related Questions
Write a program that computes the cost of a long distance call. The cost of the call is determined according to the following rate schedules. a. A call made between 8:00 AM and


Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Cross Platform Clinet app for a vpn Project Description: We want a cross platform client app for VPN. The app must have the subsequent options below: 1. Must be an open

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b


Access to the channel/devices is achieved by means of general purpose I/O routines Theses are standard functions described in stdio.h header file namely getc and putc. Getc and put

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Explain about the Variables in c language? The Variable is an identifier that is used to represent some specified kind of information within a designated portion of the program

(a) client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving