list::size
Bir listedeki öğelerin sayısını verir.
size_type size( ) const;
Dönüş Değeri
Liste uzunluğu.
Örnek
// list_size.cpp
// compile with: /EHsc
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list <int> c1;
list <int>::size_type i;
c1.push_back( 5 );
i = c1.size( );
cout << "List length is " << i << "." << endl;
c1.push_back( 7 );
i = c1.size( );
cout << "List length is now " << i << "." << endl;
}
Gereksinimler
Başlık: <list>
Namespace: std