Private member functions, C/C++ Programming

Assignment Help:

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 ( );

}


Related Discussions:- Private member functions

Ice_Cream Game, Do you have any solution on this activity?

Do you have any solution on this activity?

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Displays the temperature conversion chart on the screen, Write a program th...

Write a program that displays the following temperature conversion chart on the screen as follows below. Hint: c = 5.0/9.0 * (f - 2) C = degrees in Celsius F = degree in F

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

C help, Need help with C network program

Need help with C network program

Described access privileges in c++? what is the default , A: In C++ the acc...

A: In C++ the access privileges are public, private and protected. The default access level assigned to members of a class is private. Private members of any class are accessible o

What is default argument, Default argument: When the argument is missin...

Default argument: When the argument is missing then the function will read the default value of the missing argument.  To make use of default argument functionality the argu

PROGRAM, TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET

TO CONVERT A NUMBER OR A DIGIT INTO ALPHABET

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd