Curso de Programación en C/Prog67
Ir a la navegación
Ir a la búsqueda
Prog67
1 #include <stdio.h>
2
3 void mikado( int );
4
5 int main( void )
6 {
7 int pooh = 2, bah = 5;
8
9 printf( "En main(), pooh = %d y &pooh = %p\n",
10 pooh, &pooh);
11 printf( "En main(), bah = %d y &bah = %p\n",
12 bah, &bah);
13 mikado( pooh );
14
15 return 0;
16 }
17
18 void mikado( int bah )
19 {
20 int pooh = 10;
21
22 printf( "En mikado(), pooh = %d and &pooh = %p\n",
23 pooh, &pooh);
24 printf( "En mikado(), bah = %d and &bah = %p\n",
25 bah, &bah);
26 }
Resultado
[rrc@Pridd CClase]$ gcc -Wall -O2 -o Prog67 Prog67.c [rrc@Pridd CClase]$ ./Prog67 En main(), pooh = 2 y &pooh = 0xbfd809bc En main(), bah = 5 y &bah = 0xbfd809b8 En mikado(), pooh = 10 and &pooh = 0xbfd8098c En mikado(), bah = 2 and &bah = 0xbfd809a0 [rrc@Pridd CClase]$ vi Prog67.c [rrc@Pridd CClase]$ cat Prog67.c