+ 1
Why won't this compile?
https://code.sololearn.com/cYVz13DU1DZ3/#cpp I've got a header file here and when I instantiate a Compare class object in the main.cpp it does not compile and treats it as an abstract class even though I've implemented the definitions in the source. Any ideas?
3 Respostas
+ 2
What's your main function look like?
0
I just put this in main and that's when I get the error
int main()
{
Compare obj1("Chris",5);
}
Just passing in parameters to the constructor
- 1
Because of the virtual functions in Compare. Remove the virtual key word.