you are viewing a single comment's thread
view the rest of the comments
[–] 23 points 11 months ago (3 children)

Amazingly you can store all sorts of things in variables.

  • source
  • hideshow 3 child comments
  • [–] 13 points 11 months ago (2 children)

    Including nothing. Actually, depending on the language, multiple types of nothing (null vs uninitialized)

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 11 months ago

    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)

  • source
  • parent