Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> what is wrong with NULL?

This code has a bug, and may even crash on some architectures:

    execlp("echo", "echo", "Hello, world!", NULL);
This code doesn't have the bug:

    execlp("echo", "echo", "Hello, world!", nullptr);
Neither does this:

    execlp("echo", "echo", "Hello, world!", (char *)NULL);


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: