initialising a pointer to an object problem

Ok so code is roughly like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class someclass{
private:
   int x;
   int y;
public:
   someclass(int x1, int y1);
};
someclass::someclass(int x1, int y1):x(x1),y(y1){
}


int main(){
    someclass *a = new a(5,6);

}


It says there is no matching function call.

Thanks for any help.
closed account (3hM2Nwbp)
1
2
3
4
5
6
int main()
{
    someclass *a = new someclass(5,6);
    // I think it was just a typing error :P
    return 0; // *Edit - might want to return something so it'll compile too.
}
Last edited on
Ha thanks yeah it's been a long day.:)
Returning from main is implicit, if you do not specify a return somewhere the compiler would normally expect one for another function, main will implicitly return 0.
Topic archived. No new replies allowed.