What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace std;class B;class A {int age;public:A () { age=5; };friend class B;};class B {string name;public:B () { name="Bob"; };void Print(A ob) {cout << name << ob.age;}};int main () {A a;B b;b.Print(a);return 0;}
A. It prints: Bob5
B. It prints: Bob
C. It prints: 5
D. None of these
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What happens when you attempt to compile and run the following code?#include <iostream>#include <string>using namespace
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!