Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include "vector_dinamico.h"
  2.  
  3.  
  4. // Funciones del alumno.
  5.  
  6. void vector_destruir(vector_t* vector){
  7.  
  8. free(vector->datos);
  9. free(vector);
  10.  
  11. }
  12.  
  13.  
  14. bool vector_obtener(vector_t* vector, size_t pos, int* valor){
  15.  
  16. if (pos >= vector->tam || pos<0 ){ return false;}
  17. *valor = vector->datos[pos];
  18. return true;
  19. }
  20.  
  21.  
  22. bool vector_guardar(vector_t* vector, size_t pos, int valor){
  23.  
  24.  
  25. if (pos >= vector->tam || pos<0 ){ return false;}
  26. vector->datos[pos] = valor;
  27. return true;
  28.  
  29. }
  30.  
  31.  
  32. size_t vector_obtener_tamanio(vector_t* vector){
  33.  
  34. return vector->tam;
  35.  
  36. }
  37. // ..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement