Skip to content

sneha358/cpp_notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

cpp_notes

  1. sorting
bool myfunction (int i,int j) { return (i<j); }

 // using default comparison (operator <):
  std::sort (myvector.begin(), myvector.end());           //(12 32 45 71)
  // using function as comp
  std::sort (myvector.begin(), myvector.end(), myfunction); // (26 33 53 80)
  1. Add element at the end
    Adds a new element at the end of the vector, after its current last element. The content of val is copied (or moved) to the new element.
myvector.push_back (i);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors