GObject.Value.init

### Method

# GObject Valueinit

#### Declaration [src]

    GValue*
    g_value_init (
      GValue* value,
      GType g_type
    )

#### Description [src]

Initializes `value` to store values of the given `type`, and sets its value to the initial value for `type`.

This must be called before any other methods on a `GValue`, so the value knows what type it’s meant to store.

      GValue value = G_VALUE_INIT;

      g_value_init (&value, SOME_G_TYPE);
      …
      g_value_unset (&value);

#### Parameters

`g_type`

  Type: `GType`

  Type the `GValue` should hold values of.

#### Return value

Type: `GValue`

The `GValue` structure that has been passed in.

The returned data is owned by the instance.