Which, if any, of the following calls are illegal? Why? Which, if any, are legal but unlikely to match the programmer’s intent? Why
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:6| Question number:41
All Answers
total answers (1)
(a)
`init();`
is illegal, must have at least one argument.(b)
`init(24, 10);`
is legal.(c)
`init(14, '*');`
is legal, but unlikely to match the programer's intent. Because the character`*`
will be promoted to`int`
and match`wd`
.