[Vala] Check if pointer is null



How do I check if a pointer is null?

        pointer my_pointer = null;
        if (null == my_pointer) {
                GLib.print("pointer is null\n");
        }

gets translated to:

        gpointer my_pointer;
        my_pointer = NULL;
        if (NULL == &my_pointer) {
                g_print ("pointer is null\n");
        }

which is not what I intended.


Thanks

Frederik



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]