debug error : max must have union class struct types

Posted by hcemp on Stack Overflow See other posts from Stack Overflow or by hcemp
Published on 2010-06-03T01:46:18Z Indexed on 2010/06/03 1:54 UTC
Read the original article Hit count: 228

Filed under:

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;
  }

© Stack Overflow or respective owner

Related posts about c++