answersLogoWhite

0

Yes it can but why would you repeat the functions. If you create a module and say Public Function all you need to do call the function name and you will be able to use it.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How would you access data members of a class in cases inside member function of another class?

Either make the data members public, or make the member function a friend of the class containing the data member.


How do you call a member function of one class in another class using friend function?

class B; // forward declaration. class A { private: void myFunction(B b){b.myFunction();} // Calls private method in b. }; class B { friend void A::myFunction(B b); // Friend function declaration. private: void MyFunction(); };


Can you call main function of a class from other main function of a class if else give an example?

In Python, you cannot directly call a main function from another main function since the concept of a "main function" usually applies to the script level rather than within classes. However, you can define a method within a class and call it from another method or function. For example: class ClassA: def main(self): print("Main of ClassA") class ClassB: def main(self): obj_a = ClassA() obj_a.main() # Calling ClassA's main method b = ClassB() b.main() # This will call ClassA's main method In this example, ClassB calls the main method of ClassA.


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 member fusion in c plus plus?

If you are asking about member functions. When we declare a function inside a class then that function becomes member function of that class and this function can access the whole class


Is every class in java is subclass of itself?

A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.A class can be a subclass of another class, not of itself.


What does the word 'function' means in science class?

Function is a science class means work, or what it does.


What is the function of this in java?

this in java is a keyword that refers to the current object of the class. It is also used in constructor overloading when you want to invoke one constructor from another within the same class.


Why inherit function is not called?

Inherit is not a function. It is a class derivation where some of the methods and attributes of the new class inherit from a parent class.


What is the difference between friend function and normal member function?

We can access a Friend function from any other class in which friend function is introduced or declared even if the other class is not a member of first class. But when we use normal member function, we can have its access only in the derived classes of the first class. This is the basic difference between a friend function and a normal member function.


Can you use the same function name for a member functoin of a class and an outside function in the same program file?

Yes you can use the same function name for a member function and an external function. They are primarily distinguished by the number and type of arguments they accept (the function signature). If they match exactly, then the scope resolution operator (::) is used to differentiate them by namespace. The class namespace is the class name itself. The external function uses global scope unless scoped to another namespace. When the scope is not explicitly stated, then the scope is implied by the call site. Note that whenever there is any ambiguity about which function is implied, the compiler will emit an error indicating where the ambiguity lies, and the program will ultimately fail to compile.


What is the latent function of friends?

The only function of a friend is to extend the private class interface outwith the class, essentially making the friend part of the class interface.