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
Answers were Sorted based on User's Feedback
Answer / naveen
yes, by using inheritance we can access public members of
class in other class
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / 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 |
Answer / poorna chandar rao
yes accesses the public member of data of another class by
using Extend from another class
| Is This Answer Correct ? | 2 Yes | 1 No |
What language is oop?
What is object and class in oops?
What is the output of the following code: int v() { int m=0; return m++; } int main() { cout<<v(); } 1) 1 2) 0 3) Code cannot compile
Have you ever used threads?
what is inline function?
What is Method overloading?
What is polymorphism and types?
What is the diamond problem in inheritance?
Are polymorphisms mutations?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
What is static modifier?
In c++ there is only virtual destructors, no constructors. Why?