actually, you can even store pointers to nothing in memory. you just do:
void x;
void* x_ptr = &x;
then you can use it to invoke functions that take no arguments like this:
voidopen_texteditor(void editor_choice){
// do nothing with the editor_choice because there is only one sensible editoropen_nano();
returnvoid;
}
void favorite_texteditor;
void result = open_texteditor(favorite_texteditor);
print_error_on_bad_result(result);
Amazingly you can store all sorts of things in variables.
Including nothing. Actually, depending on the language, multiple types of nothing (null vs uninitialized)
actually, you can even store pointers to nothing in memory. you just do:
void x; void* x_ptr = &x;then you can use it to invoke functions that take no arguments like this:
void open_texteditor (void editor_choice) { // do nothing with the editor_choice because there is only one sensible editor open_nano(); return void; } void favorite_texteditor; void result = open_texteditor(favorite_texteditor); print_error_on_bad_result(result);(note that this is a joke comment)
This has made a lot of people very angry and been widely regarded as a bad move.