size [C++ Reference]
Keywords: valarray,size
Date: 2009-06-26T12:16:09-0700

[[size]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## size

Syntax:

        #include <valarray>
        size_t size() const;

The size() function returns the number of elements in the valarray.

       #include <valarray>
       #include <iostream>

       const int vd[] = {1,2,3,4,5};
       std::valarray<int> v1(vd,5);
       std::cout << v1.size() << std::endl;

Will produce this output:

       5

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •