FresHHerB

Tamanho vetor

Mar 25th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int retornaMediana(int *vetor){
  5.  
  6.     int tam=0;
  7.  
  8.     tam = sizeof(vetor);
  9.  
  10.     printf("TESTE: %d, %d, %d\n\n",vetor[0],vetor[1],vetor[2]);
  11.  
  12.     return tam;
  13.  
  14. }
  15.  
  16. void main(){
  17.  
  18.     int vetor[] = {5,25,7,10,13,33,45,11,60};
  19.     int n = retornaMediana(&vetor);
  20.     int n2;
  21.  
  22.     n2 = sizeof(vetor)/sizeof(int);
  23.  
  24.     printf("TAMANHO = %d\n\n",n);
  25.     printf("TAMANHO = %d\n\n",n2);
  26.  
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment