Is there any practical use for a function that does nothing?

Such a function could be necessary as a callback function.

Supposed you had a function that looked like this:

void do_something(int param1, char *param2, void (*callback)(void))
{
    // do something with param1 and param2
    callback();
}

This function receives a pointer to a function which it subsequently calls. If you don’t particularly need to use this callback for anything, you would pass a function that does nothing:

do_something(3, "test", Nothing);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)