wrong code
- cpp Code: Select all
//constructor
SomeClass::SomeClass(something & ref, foo * p) //compiler gives error but on 2nd parameter
{
}
returned error when I try to call constructor
- cpp Code: Select all
No matching function for call SomeClass::SomeClass(something & ref, foo *& p)
Candidates are...
No matching function for call SomeClass::SomeClass(something & ref, int) //in this case null pointer is detected as "int" O_O
Candidates are...
correct code:
- cpp Code: Select all
//constructor
SomeClass::SomeClass(const something & ref, foo * p) //compile without errors.
{
}
I feel like I'm missing some fundamental thing. Tried to google and read FAQS but didn't find anything


