In C, what exactly happens when you pass a NULL pointer to strcmp()?

It depends on the implementation, which is free to assume your parameters are valid (i.e. not null in this case). The behaviour may or may not be reproducible from execution to execution, or from one implementation/platform to another.

Leave a Comment