Scroll to navigation

MAT_VARGETSTRUCTFIELDBYINDEX(3) Library Functions Manual MAT_VARGETSTRUCTFIELDBYINDEX(3)

NAME

Mat_VarGetStructFieldByIndex — Gets a structure field by field index.

SYNOPSIS

#include <matio.h>

matvar_t *
Mat_VarGetStructFieldByIndex(const matvar_t *matvar, size_t field_index, size_t index);

DESCRIPTION

The () function returns a pointer to the field at 0-relative field index field_index for the structure element at linear index index in the structure variable matvar. The function requires matvar to be a valid structure or object variable.

RETURN VALUES

On success, a pointer to the requested field is returned. Otherwise NULL is returned.

EXAMPLES

This example gets the second field of the first structure element.

matvar_t *field;

field = Mat_VarGetStructFieldByIndex(matvar, 1, 0);

SEE ALSO

Mat_VarGetStructField(3), Mat_VarGetStructFieldByName(3), Mat_VarGetStructFieldnames(3), Mat_VarGetNumberOfFields(3)

April 23, 2026 Nixpkgs