More Related Content
More from marenostrumad (20)
test
- 1. 04/27/11 t.c 1
file:///home/ciprian/work/c/t.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
void g(int argc, int * pos, char ** argv)
{printf("argc=%d pos=%dn",argc,*pos);
int a,b;
a = 3; b = 4;
while(*pos<argc)
{
printf("pointer to pos=%d pos=%d val=%sn",pos,*pos,argv[(*pos)++]);
}
*pos = a+b;
}
int main(int argc, char ** argv)
{
int p = 1;
printf("pointer to pos=%d pos=%dn",&p,p);
g(argc,&p,argv);
printf("pointer to pos=%d pos=%dn",&p,p);
return 0;
}