Identify the error(s) in the following code fragment:
int x = 5;
int y = 3;
class Outer {
public:
int x;
int a;
static int s;
class Inner {
public:
void f(int i)
{
x = i;
s = i;
y = i;
a = i;
}
};
// Inner defination over
Inner I1; //Inner object
void g(it i)
{
x = i;
y = i;
a = i;
s = i;
}
};
//outer definition over
Outer Ob1; // outer object int main()
{
Ob1.I1.f(3);//statement1
Ob1.g(8); //statement2
return 0;
}
What will be the values of ::x, ::y, Outer::x, Outer::a, Outer::s, Inner::a after statement 1 and statement 2 of above code?
All Replies
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.