Re: почему ругается компилятор? MSVC 2010
От: Великий Мессия google
Дата: 30.06.25 15:33
Оценка: +1
а что из сообщений компилятора вам не понятно?

<source>:24:11: error: 'print' is a private member of 'Child'
24 | child.print(10);
| ^
<source>:15:18: note: implicitly declared private here
15 | virtual void print(int x, int y)
| ^
<source>:24:11: error: too few arguments to function call, expected 2, have 1; did you mean 'Parent::print'?
24 | child.print(10);
| ^~~~~
| Parent::print
<source>:6:18: note: 'Parent::print' declared here
6 | virtual void print(int x)
| ^
2 errors generated.
Compiler returned: 1

 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.