3 ms·
if (getcwd(cwd, sizeof(cwd)) != NULL) ; else perror("getcwd() error"); Is that common? What's the advantages over the below? if (... =
by ajanuary 14y ago
if (getcwd(cwd, sizeof(cwd)) != NULL)
;
else
perror("getcwd() error");
Is that common? What's the advantages over the below?
if (... == NULL) {
perror(...);
}
- tptacek 14y agoNo, it's not common. This is not idiomatic C code (not that that's an intrinsic problem).