Question.1
A UART logger has two overloads:
void log(int code) { printf("CODE:%d", code); } void log(const char *msg) { printf("MSG:%s", msg); } log(NULL); log(nullptr);
What happens?
Select Answer
Both call log(char*) -- NULL and nullptr are equivalent
char*
log(NULL) is ambiguous or calls log(int) because NULL is integer 0; log(nullptr) correctly calls log(char*)
log(NULL)
log(int)
log(nullptr)
log(char*)
Both call log(int)
Compilation error for both