IDebugArrayField::GetRank
Note
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
Gets the rank or number of dimensions of the array.
Syntax
HRESULT GetRank(
DWORD* pdwRank
);
int GetRank(
out uint pdwRank
);
Parameters
pdwRank
[out] Returns the rank.
Return Value
If successful, returns S_OK; otherwise, returns an error code.
Remarks
The rank of an array corresponds to the number of dimensions. In C++ and C#, multi-dimensional arrays are really arrays of arrays and can therefore be considered just a one-dimensional array (and the GetRank
method always returns 1). In Visual Basic, on the other hand, multi-dimensional arrays are handled differently and the rank of such an array reflects the number of dimensions (and the GetRank
method always returns the number of dimensions).