Pls...could any one tell me that whether we can access the
public data memeber of a class from another class with in
the same program.
Awaiting for your response Thanku
Answer Posted / pramod
If it's about the data accessing, whether public or private
... you can use friend function.This friend function can be
member of 2nd class and friend for the 1st class.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Why do we use oops?
What is overriding in oops?
What do you mean by abstraction?
What is inheritance in simple words?
What is protected in oop?
can inline function declare in private part of class?
Why is polymorphism used?
What is interface in oop?
What is overloading and its types?
What are the benefits of polymorphism?
Why is there no multiple inheritance?
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Give two or more real cenario of virtual function and vertual object
write a program that takes input in digits and display the result in words from 1 to 1000
What is purpose of inheritance?