Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "vector_dinamico.h"
- // Funciones del alumno.
- void vector_destruir(vector_t* vector){
- free(vector->datos);
- free(vector);
- }
- bool vector_obtener(vector_t* vector, size_t pos, int* valor){
- if (pos >= vector->tam || pos<0 ){ return false;}
- *valor = vector->datos[pos];
- return true;
- }
- bool vector_guardar(vector_t* vector, size_t pos, int valor){
- if (pos >= vector->tam || pos<0 ){ return false;}
- vector->datos[pos] = valor;
- return true;
- }
- size_t vector_obtener_tamanio(vector_t* vector){
- return vector->tam;
- }
- // ..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement