Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Latest commit

History

History
16 lines (12 loc) 路 447 Bytes

emplace.md

File metadata and controls

16 lines (12 loc) 路 447 Bytes

emplace

Description: Places an element in the vector at the specified position

Example:

    //creating a vector of 5 elements
    std::vector<int> vector1{10, 20, 30, 40, 50};

    //function to add an element at the beginning and the end
    vector1.emplace(vector1.begin(), -10);
    vector1.emplace(vector1.end(), 60);

See Sample Code Run Code