Search
 
SCRIPT & CODE EXAMPLE
 

CPP

back() in c++

// my linkedin : https://www.linkedin.com/in/vaalarivan-prasanna-3a07bb203/
vector<int> vec = {1, 2, 5, 6};
int ele = vec.back();  //ele = 6
//back() method does delete the last element from the vector, it just returns

//the last element.
Comment

c++ back()

// string::back
#include <iostream>
#include <string>

int main ()
{
  std::string str ("hello world.");
  str.back() = '!';
  std::cout << str << '
';
  return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: use uint in c++ 
Cpp :: C++ Volume of a Cylinder 
Cpp :: string to upper c++ 
Cpp :: char size length c++ 
Cpp :: how to remove a index from a string in cpp 
Cpp :: print octal number in c++ 
Cpp :: built in function in c++ for binary to decimal 
Cpp :: how to sort vector of struct in c++ 
Cpp :: How to write into files in C++ 
Cpp :: c++ pass array to a function 
Cpp :: how do you wait in C++ 
Cpp :: reverse function in cpp array 
Cpp :: char to integer c++ 
Cpp :: What is the "--" operator in C/C++? 
Cpp :: card validator c++ 
Cpp :: c++ check substring 
Cpp :: c++ reverse string 
Cpp :: creare array con c++ 
Cpp :: dynamic allocation c++ 
Cpp :: c++ float and double 
Cpp :: joining two vectors in c++ 
Cpp :: cpp auto 
Cpp :: c++ reverse part of vector 
Cpp :: stl function to reverse an array 
Cpp :: tuple vector c++ 
Cpp :: linked list cycle c++ 
Cpp :: initialising 2d vector 
Cpp :: use of strstr in c++ 
Cpp :: create a vector of size n in c++ 
Cpp :: even and odd in c++ 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =