#include<iostream.h>
//main()
//{
class A
{
friend class B;
public:
void read();
};
class B
{
public :
int a,b;
};
void A::read()
{
cout<<"welcome";
}
main()
{
A x;
B y;
y.read();
}
In the above program......,
as B is a friend of A B can have access to all members,i
cant access y.read .
could you please tell me the reason and what would i code
to execute this program?
Answers were Sorted based on User's Feedback
Answer / manzoor
write a program to larger of two number by using friend
function in c++
Is This Answer Correct ? | 5 Yes | 0 No |
write a program that can locate elements in array.
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
i don't know about working of nested for loop can any one help me
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
void main() { int i,j=2; for(i=0;i<3;i++) if(j=i) cout<<"Lotus "; else cout<<"Rose "; } Its result is Rose Lotus Lotus.. How? Explain it?
Perform the functionality of 2-D array through 1-D array and in it the functions to be performed were: (1) Display the array in 2-D format (2) Display a particular element (3) Display a particular row (4) Display a particular column
write a program to perform generic sort in arrays?
how to diplay a external image of output on winxp by using c & c++,
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20
How to Split Strings with Regex in Managed C++ Applications?
Code for Two Classes for Doing Gzip in Memory?
Subsets Write an algorithm that prints out all the subsets of 3 elements of a set of n elements. The elements of the set are stored in a list that is the input to the algorithm. (Since it is a set, you may assume all elements in the list are distinct.)
1 Answers CSC, Qatar University,