0% found this document useful (0 votes)
14 views2 pages

What Do U Understand by A Member Function

This document discusses member functions versus ordinary functions, how classes enforce data hiding, abstraction, and encapsulation through private and protected members, rules of inheritance including what is accessible by objects and member functions, bytes occupied by different data types, and pointers not being able to be subdivided upon inheritance.

Uploaded by

sanket dash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

What Do U Understand by A Member Function

This document discusses member functions versus ordinary functions, how classes enforce data hiding, abstraction, and encapsulation through private and protected members, rules of inheritance including what is accessible by objects and member functions, bytes occupied by different data types, and pointers not being able to be subdivided upon inheritance.

Uploaded by

sanket dash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

What do u understand by a member function?

how does a member function


differ from an ordinary function ?

Ans:-member function has full access priviledge to both the public and private
memebers of the class while in general non member functions have access only
to the public datamembers of the class.

Member functions are defined within the class scope that is they are not visible
outside the scope of class .nonmember functions are visible outside the class.

1.HOW DOES A CLASS ENFORCE DATA HIDING ,ABSTRACTION,AND


ENCAPSULATION ?

ANS:-a class binds together data and its associated functions under one unit
thereby enforcing encapsulation as encapsulation means wrapping up data and
associated functions together into a single unit. A class group its members into
three sections private ,protected and public .the private and protected members
remain hidden from outside world .thus through private and protected members
a class enforces data hiding .the outside world is given only the essentisal and
necessary information through public members rest of the things remain hidden
which is nothing but abstraction.as abstraction means representation of
essential features without including the background details or explanation.

Rules of inheritance
Accessible by object :-
1.public members of own class

2. publicly derieved public members of all other base classes

Accessible by member function:-


1.all memebers of own class

2. public and protected members of all other linked base classes.(private , public
, protected)

BYTES OCCUPIED:-
Char-1

Int/short-2

‘long/float-4

Double-8

Long double-8

Pointer-2

@the pointer access cannot be underutilised upon the sub didvisional classes
which are not permitted upon the socialbele opportunituies

These obsessive accounts cannot be inherited upon the blessible works of a


command section]

These are to connnentioinedised upon the upportinieties

Opportunities upon all having none and all above

Having upon

You might also like