Skip to content

SageInterface::get_C_array_dimensions

returns the array dimensions in an array as defined for arrtype

Synopsis

Declared in <SageIII/sageInterface/sageInterface.h>

std::vector<SgExpression*>
get_C_array_dimensions(SgArrayType const& arrtype);

Description

int x[] = { 1, 2, 3 };

note, the expression does not have to be a constant

int x[i*5];

Return Value

an array that contains an expression indicating each dimension's size. OWNERSHIP of the expressions is TRANSFERED TO the CALLER (which becomes responsible for freeing the expressions). Note, the first entry of the array is a SgNullExpression, iff the first array dimension was not specified.

Parameters

Name

Description

arrtype

the type of a C/C++ array

Postconditions

  • return‐value.empty() == false

  • return‐value[]!= NULL (no nullptr in the returned vector)

Created with MrDocs