Difference between revisions of "C: Ponteiro para array"
From AdonaiMedrado.Pro.Br
(New page: <code lang="c"> #include <stdio.h> #define TAMANHO_VETOR 10 int main(void) { int v[10]; int i; int *p=v; printf("%p (p)==%p (v)\n",p,v); printf("%p (&p)==%p (&v)\n",&p,&v); for(i=...) |
|||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
int main(void) | int main(void) | ||
{ | { | ||
− | int v[ | + | int v[TAMANHO_VETOR]; |
int i; | int i; | ||
int *p=v; | int *p=v; | ||
printf("%p (p)==%p (v)\n",p,v); | printf("%p (p)==%p (v)\n",p,v); | ||
− | printf("%p (&p) | + | printf("%p (&p)!=%p (&v)\n",&p,&v); |
for(i=0;i<TAMANHO_VETOR;i++) | for(i=0;i<TAMANHO_VETOR;i++) |