System.Collections.Stack.Count Property

Gets the number of elements contained in the Stack.

Syntax

public virtual int Count { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The capacity is the number of elements that the Stack can store. Stack.Count is the number of elements that are actually in the Stack.

The capacity is always greater than or equal to Stack.Count. If Stack.Count exceeds the capacity while adding elements, the capacity is automatically increased by reallocating the internal array before copying the old elements and adding the new elements.

Retrieving the value of this property is an O(1) operation.

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0