Search:
Forum
Beginners
Did I do this correctly?
Did I do this correctly?
May 2, 2013 at 11:13pm UTC
njabbour
(31)
Modify the following code to:
Declare class A to be a friend of class B.
Declare function double compute(A& data) to be a friend of class A.
1
2
3
4
5
6
7
8
9
class
A {
friend
double
compute (A& data) };
class
B {
friend
class
A; };
May 2, 2013 at 11:25pm UTC
Computergeek01
(3013)
Declare class A to be a friend of class B.
This is generally done on the stack, I'm having trouble remembering if it makes a difference. I don't think it does.
Declare function double compute(A& data) to be a friend of class A.
You're missing a semicolon at the end of Line 3.
May 2, 2013 at 11:30pm UTC
njabbour
(31)
friend double compute (A& data)
so this is the correct format? for :Declare function double compute(A& data) to be a friend of class A.
Registered users can post here.
Sign in or register
to post.
C++
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs