FranciscoSoccol

Lista 08 - Exercicio 05

Aug 10th, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. //prototipo
  5. void preencheVetor(int vetor[], int qtde);
  6. void exibeVetor(int *vet[], int qtde);
  7.  
  8. int main()
  9. {
  10.     int qtde, i;
  11.     printf("Digite o tamanho do vetor: ");
  12.     scanf("%d",&qtde);
  13.     int vet[qtde];
  14.     for(i=0;i<qtde;i++){
  15.         printf("Digite um numero: ");
  16.         scanf("%d",&vet[i]);}//preenche o vetor
  17.     exibeVetor(vet,qtde);
  18.     return 0;
  19. }
  20.  
  21. //funçao exibe
  22. void exibeVetor(int *vet[], int qtde)
  23. {
  24.     int i;
  25.     for(i=0;i<qtde;i++,vet++)
  26.         printf("%d ", *vet);//exibe o endereç de memoria de vet
  27. }
Advertisement
Add Comment
Please, Sign In to add comment