Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define INCREMENTO 5
- template<typename T>
- void aumentarEspacios(T* &arr, int num, int &tam) {
- tam += INCREMENTO;
- T* aux_arr = new T [tam];
- for (int i = 0; i < num; i++)
- aux_arr[i] = arr[i];
- delete[] arr;
- arr = aux_arr;
- }
- /* Si esta siendo llamado de otro archivo .cpp, no olvidar colocar los tipos particulares que va a recibir, por ejemplo: */
- template void aumentarEspacios(int* &arr, int num, int &tam);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement