In python, there's a function call append to add an item into the back of the list. Is there similar function in C++ to add an item into the array? Or is there any other alternative method so that I can add item into an array with undefined size?
#include <iostream>
using namespace std;
int main(){
int list1[] = {1,2,3,4};
//a function that add an item at the back of the array;
cout<<list1[4]<<endl;
return 0;
}