I was just wondering how to pass two objects s1 and s2, both of which have to arguments, to a function, someFunction(). I actually only want to pass the second argument of each object for s1 and s2 to the same function, compare the two arguments and then display some sort of output. Is there a way to do this easily?
(
class SomeObject
{
private:
int a,
b;
public:
int someFunction(SomeObject & other);
}
int SomeObject::someFunction(SomeObject & other)
{
//trying to compare s1's second argument 2 and s2's second argument 4
//and return their comparison (not as a bool) as int b and other.b, private data
//member
}
int main()
{
SomeObject s1(1,2), s2(3,4);
return 0;
}