I had recently joined B.Tech. Computer Science, and i am doing C++.
I am facing problems while using classess within classes.
Can somebody help me out in this case.
//Point.cpp
#include "Point.h"
Point :: Point( int x0, int y0 )
{
setX(x0);
setY(y0);
}
void Point :: setX( int x0 )
{
x = x0;
}
int Point :: getX( void )
{
return x;
}
int Point :: getY( void )
{
return y;
}
void Point :: setY( int y0 )
{
y = y0;
}
void Point :: print( void )
{
cout << "(" << x << "," << y << ")" << endl;
}
is that something related to inner classes ? like this :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class one
{
class two
{
int a;
int b;
};
void fun1()
{
two obj1;
....... some blah blah .........
}
.............
............
};
then these are called as inner classes, they are supported both by java and c++. Inner classes scope only remains within the class which is defining it. If you can what exactly are looking for, then i may provide some detail