ios_base::pword


public member function
void* & pword (int idx);

Get reference to pointer of the internal extensible array

Returns a reference to the pointer element correponding to the index idx of the internal extensible array. If idx is an index to a new element and the internal extensible array is not long enough (or is not yet allocated), the function extends it (or allocates it) with as many zero-initialized elements as necessary.

idx should be a value previously returned by xalloc.

The refence returned is granted to be valid at least until another operation is performed on the stream object, including another call to pword. Once another operation is performed, the reference may become invalid, although a subsequent call to this same function with the same idx argument will return a value referring to the same pointer within the internal extensible array.

The internal extensible array is a general-purpose array of word-sized elements associated with a stream object that can be used to temporarily store data.

Parameters

idx
The index value of an element of the internal extensible array.
This value should have been obtained by a previous call to xalloc.

Return Value

A reference to the element in the internal extensible array whose index is idx.
This value is returned as a reference to an object of type void*.
On failure, a valid void*& initialized to 0 is returned.

See also