Articole de pe: blogs.perl.org — blogging the onion

ARTICOLE: Announcing meta::hack v2I’m wondering how to learn good perlPerl 5 Porters Mailing List Summary: October 2nd-9thDocker based Continuous Integration for perl projectsDancer 2017 Survey: UpdatePerl 6 at the London Perl Workshop – 25 Nov 2017Fancy a Game of (Code) Golf?Machine learning in Perl, Part3: Deep Convolutional Generative Adversarial networkIridium Flare End-Of-LifeCPAN6 Is HereRakudo.js update – passes 64.65% roast testPerl less buggy than Python?Strawberry Perl 5.26.1.1 and 5.24.3.1 releasedCall for Lightning Talks — London Perl WorkshopPerl 5 Porters Mailing List Summary: September 25th – October 1stDancer Survey 2017How to do Bit Operation Correctly in Perl? One Answer is SPVM.Not-Perl: Career Advice for ProgrammersYAML::PP Grant Report August/September 20176lang: The Naming Discussion Update

Libraria STL din Cpp

Standard Template Library(STL) este un set de funcții si algoritmi capabile să manipuleze datele definite de utilizator. Containerul vector din STL poate fi utilizat pentru stocarea datelor de orice tip.

 

Un vector este un array(tablou) care are dimensiunea variabila. Utilizarea clasei vector intr-un program cpp:


#include
#include

using namespace std;

int main()
{
    cout << "Hello world, from Vector test!" << endl;
    //use constructors from vector class
    vector vint;
    vector vdouble(4, 2.34);
    vector vfloat(vdouble.begin(), vdouble.end());
    vector vchar={'a', 'b', 'c','d'};
    //add element to vector vint
    vint.push_back(2);
    vint.push_back(10);
    //iterate in vector and print elements
    cout<<"The content of vector vint: ";
    for(vector::iterator it = vint.begin(); it!=vint.end(); ++it)
        cout<<" "<<*it;
    cout<<"\n";

    cout<<"The content of vector vdouble: ";
    for(vector::iterator it = vdouble.begin(); it!=vdouble.end(); ++it)
        cout<<" "<<*it;
    cout<<"\n";

    cout<<"The content of vector vdouble: ";
    for(vector::iterator it = vfloat.begin(); it!=vfloat.end(); ++it)
        cout<<" "<<*it;
    cout<<"\n";

    cout<<"The content of vector vdouble: ";
    for(vector::iterator it = vchar.begin(); it!=vchar.end(); ++it)
        cout<<" "<<*it;
    cout<<"\n";
    return 0;
}

Proiectul este disponibil pentru descarcare pe: //www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=13977&lngWId=3.