debug error : max must have union class struct types
- by hcemp
this is my code:
#include <iostream>
using namespace std;
class Sp
{
private :
int a;int b;
public:
Sp(int x=0,int y=0):a(x),b(y){};
int max(int x,int y);
};
int Sp::max(int a,int b)
{ return (a>b?a:b);};
int main()
{
int q,q1;
cin>>q>>q1;
Sp *mm=new Sp(q,q1);
cout<< mm.max(q,q1);
return 0;
}