Re: [Vala] Check if pointer is null



On Wed, May 7, 2008 09:38, Frederik wrote:
How do I check if a pointer is null?

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

Don't use `pointer', it has been replaced by native pointer support some
time ago and completely removed in Vala 0.3.1.

The following code snippet works fine:

    void* my_pointer = null;
    if (null == my_pointer) {
        message ("pointer is null");
    }

Juerg





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