answersLogoWhite

0


Best Answer

ObjectReference.MemberName Objectname :: memberfunction

User Avatar

Wiki User

โˆ™ 2009-09-04 13:51:50
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
User Avatar
Study guides
๐Ÿ““
See all Study Guides
โœ๏ธ
Create a Study Guide

Add your answer:

Earn +20 pts
Q: What are different ways by which you can access public member functions of an object?
Write your answer...
Submit
Related questions

Why static functions cannot use instant variables?

Static functions are tied to a class, not to a particular object. A static function can only access static variables because it has no knowledge of member variables.


Why are friend functions used in object oriented programming?

A friend function is a function that cannot be declared a member of a class but which requires private access to that class. For example, a function that operates upon two different classes cannot be a member of both classes, but if the function requires private access to both classes then it has to be a friend to at least one of them.To fully appreciate friend functions, consider that a non-static member function has the following three properties:Has private access to the class.Is scoped to the class.Must be invoked against an object of the class (has a 'this' pointer).Static member functions have the first two properties only while friend functions have the first property only. All other non-member functions have none of these properties.


Member function differ in c and c plus plus?

C is not an object oriented language, therefore it has no member functions, thus it cannot be compared with C++ member functions.


What is the Difference between normal function and member function?

A normal or ordinary function is any function declared outside of any class definition. A member function is a function declared inside a class definition; it is a member of the class in which it is declared and therefore has private access to the class representation. Non-static member functions are scoped to an object of the class and have an implicit this pointer which refers to that object. Static member functions are scoped to the class as a whole and do not require any instances. Non-member functions that require private access may be declared friends of the class; a friend function may be an ordinary function or a member of another class.Non-static member functions have the following three properties:Private access to the class representation.Scoped to the class.Must be invoked against an instance of the class (have a this pointer).Static member functions have the first two properties only while friend functions have the first property only. Functions that are neither members of the class nor friends of the class have none of these properties.


What are data members and member functions?

Data members are any containers that hold data, like variables or arrays inside object definitions. Member functions are methods or functions that are defined inside of objects and are generally used to manipulate data members and other object data.


What is the difference between a class method and object in object-oriented C?

Class methods are the member functions that act upon member variables. An object is an instance of a class. C does not support object-oriented programming, but C++ does.


What are points for classes?

Classes make it easy to put a same kind of codes and stuff in same section. This way all the codes and functions are accessible from a single object. The single object can be used to access all the functions allowing you to have a single access.


Who can always reset the permission of an object to allow himself access to the object?

administrators group member for the particular system adminstrators group member of the domain


What are the advantages of friend function?

If a non-member function requires access to a class representation where a public interface would be undesirable, you have to declare that function a friend of the class. Only the class itself can grant friend access. All non-static member functions have the following three properties: 1. Private access to the class representation. 2. Scoped to the class. 3. Must be invoked on an object of the class (has a this pointer). Static member functions only have the first two properties while friend functions only have the first property. All other functions have none of these properties.


How do you differentiate between a member function and normal function?

A normal function is any function that is not a member of any class. Normal functions that operate upon a class are referred to as non-member functions, however a non-member function can also be a member of another class. Any class may declare any non-member function to be a friend of the class, in which case the function becomes a friend function.A member function is a member of a class and may be declared static or non-static. Non-static member functions have the following 3 properties:Private access to the class members.Scoped to the class.Must be invoked against an object of the class (has a 'this' pointer).Static member functions have the first two properties only while friend functions have the first property only. Non-member functions that are not friends of the class have none of these properties.


What is advantage disadvantage of friend function in C?

C is not object oriented programming language thus there are no friend functions in C. In C++, which is object oriented, the advantage of a friend is that it allows code that cannot otherwise be regarded as being a member of the class to gain private access to the class representation, where public access to the representation would be considered undesirable. Although many see friendship as an undermining of encapsulation, the reality is it strengthens encapsulation by limiting exposure to the representation to only those functions that actually require that access. Public access is fully accessible, of course, but is not always desirable. Interfaces must be kept as simple as possible, but exposing an interface that is only of use to a few non-member functions is less desirable than simply making those functions friends of the class. It is important to understand the relationships between functions and classes. All functions can be divided into one of three distinct categories with respect to any one class: non-member functions; static member functions or; nonstatic member functions. Nonstatic member functions of a class have all three of the following properties: 1. The function has private access to the class representation. 2. The function is scoped to the class. 3. The function must be invoked upon an object of the class (has a 'this' pointer). Static member functions only have the first two properties while friend functions only have the first property. External (non-friend) functions do not have any of these properties. The only disadvantage to a friend function is when that friend is outwith the control of the class designer. Since friends have private access they must obey the class invariants, just as any member of the class must. Although they are not members of the class per se, they must be implemented just as if they were. In other words, they must not invalidate the representation. When the class designer has full control over the friends of that class then this is not a major problem. But when third-party programmers have access to the friend implementations, encapsulation can no longer be guaranteed by the class designer -- it is seriously undermined. But when used appropriately, friends actively re-enforce encapsulation and are no more an undermining of encapsulation than is public inheritance.


When member functions behave differently depending upon which object performed the call this is an example of?

Scope resolution.


What do you mean by class and object in java?

class is a collection of data and member functions,and collection of variables and methods..


Why you are using class in c plus plus?

since c++ is an object oriented programming language we use object to access each data member & member functions.so that class concept is come on


Why a member of class static?

Static members are local to the class rather than to instances of the class. In other words, they are shared amongst all instances of the class. Moreover, since they are static, they exist even when no instances of the class exist. Thus static member methods and friends of the class can access static member variables and external functions can access the public static members, without instantiating an object of the class.


What are the distinguishing factors between member functions in c plus plus and functions in c?

There is no real distinction required since C is not an object-oriented programming environment and therefore has no such concept as a member function. C++ does, but the only distinguishing factor is that a member function has access to the implicit this pointer, which is never NULL and therefore refers to the current instance of the class. The only exceptions are static member functions, which are scoped to the class as a whole, not to any instance of the class, and therefore have no access to the implicit this pointer (although as members of the class they still have private access to the class).There are more fundamental differences within the calling convention, of course, but since C has no concept of class, you cannot call C++ member functions in C code. Normal C++ functions, including overloaded functions, can be declared 'extern "C"' to ensure they follow the C calling conventions, but member functions cannot. For the same reason, C++ structs must not have any member methods associated with them if they are to be utilised by C.Aside from access to the implicit this pointer, functions in C are, by and large, no different to functions in C++, including member functions. However, the type-safety of C++ is much more strictly enforced than in C, thus there are some differences in this respect. Moreover, in C it is not always necessary to declare functions with forward declarations before they are used, but in C++ this rule is strictly enforced.However, conversely, in some areas the rules are relaxed. For instance, the main function is typically declared as 'int main()' and must therefore return a value, usually via a 'return 0;' statement (typically used to indicate to the caller that the program completed successfully). But in C++, the 'return 0;' is implicit.


Advantage of this pointer?

this pointer stores the address of the class instance, to enable pointer access of the members to the member functions of the class.this pointer is not counted for calculating the size of the object.this pointers are not accessible for static member functions.this pointers are not modifiable.


How can you access private functions of a class from the Main function in Cpp?

Any member functions and data members declared as 'private' in a class, can only be accessed directly by functions within the class.They cannot be accessed directly by derived objects, nor from anywhere outside an object of the class, such as from the Main function.To access private class members, you must rely on what are called accessor functions. Accessor functions are functions inside the class, either public or protected, which automatically have access to private members.If a function from Main, or elsewhere outside the class hierarchy, needs access, then you need to use publicaccessor functions. For derived class access, you can use protected accessor functions.


What are the three basic principles of object oriented programming language?

1) encapsulation: the wrapping of data members and member functions into a single unit . 2) abstraction : the process of hiding the background details and displaying the essential features of a class or an object. 3) inheritance : the sharing data members and member functions of an object with the class .


When do we declare member of a class as static in c plus plus?

We declare a member static when the member is to be regarded as being local to the class rather than local to each instance of the class. That is; there is only ever one instance of the member rather than one per object. We use static member variables for data that is shared amongst all instances of the class. Fort that reason, non-static member variables are often called instance variables since each instance has its own discrete set of non-static member data. Static member functions, on the other hand, are the same as non-static member functions except that they do not have access to an implicit this pointer. As such, public static member functions can be invoked even when there are no objects of the class in memory.


What is member functions in oops?

Instance methods, or object behaviors. Member, most of time is referred to the one of "instance" (vs static/class member). Functions are methods. Any method in OOP must be defined and/or implemented by (within) a class, like a member (part) of that class.


What are the application of this pointer can you use this pointer in friend function justify?

The this pointer can only be used within nonstatic member functions. Friend functions are not members so they have no access to a this pointer. However, you can pass a specific instance of a class to a function via a class reference argument. To understand how friendship works, first understand that a nonstatic member function has the following properties: 1. It has private access to the class. 2. It is scoped to the class. 3. It must be invoked upon an object of the class (has a this pointer). Static member functions have the first two properties while friend functions only have the first property.


How do i create a sims 2 object?

Sorry don't think you can. But you can download objects off of the internet of off different websites :) Depends on what you want to do. Do you just want a different color of an existing object? Do you want an object with the same functions as an existing object but a different shape? Do you want an object with slightly different functions? Your best bet is to google for what you want; it's quite likely that someone else has already made something similar.


What is a class?

class is summation of data member and data types(basically known as instance variable of a class). making a class is basically an encapsulation under various access specifiers on which its object accessibility depends. these data functions can be accessed inside or outside the class with the help of object(class variable) of a class. an object defined in another class(i.e. outside the original class) can access its own class members which r not declared under private mode but can access public members and it is derived then can also access protected data members or data types also.


What is data encapsulation?

Data encapsulation refers to a means of limiting data access only to those functions that actually require direct access. Object-oriented programming languages such as C++ use access specifiers (public, private and protected) to determine the accessibility (or visibility) of an object's data or, more specifically, its representation.Public member data is accessible to any function (no encapsulation).Private member data is accessible only to the class member functions and to friends of the class (full encapsulation).Protected member data is the same as private member data and is also accessible to implementers of derived classes and to friends of those classes (partial encapsulation).For most classes, data members are declared private, thus fully encapsulating the data.