F
free2cric
Hi,
Just posting a sample progam.
class asd's member function calls function b which is not a member
function and passes it a class's variable as parameter . Should the
called function be a member of class? logically we can call it. but
what do u think what is a good practice??? thanks cric.
int b(int t)
{
return (t*t)
}
class asd
{
private:
int type;
int v;
public:
asd() { type = 10; }
void a();
};
void asd::a()
{
v= 10 * b(type);
}
Just posting a sample progam.
class asd's member function calls function b which is not a member
function and passes it a class's variable as parameter . Should the
called function be a member of class? logically we can call it. but
what do u think what is a good practice??? thanks cric.
int b(int t)
{
return (t*t)
}
class asd
{
private:
int type;
int v;
public:
asd() { type = 10; }
void a();
};
void asd::a()
{
v= 10 * b(type);
}