ASR3/ASR3.1/TP01/adresses_virtuelles.c
2021-09-27 16:47:54 +02:00

27 lines
525 B
C

/* adresses virtuelles d'un processus */
#include<stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include<stdlib.h>
int t[1000] = {[0 ... 999] = 2};
int main(int argc, char * argv[])
{
int i=3;
static int j = 3;
char * m = (char*)malloc(1);
printf("je suis le pid %d\n\n",getpid());
/* ------- Affichage des adresses --------*/
printf("main\t=\t%p\n",main);
printf("&argc\t=\t%p\n",&argc);
printf("&i\t=\t%p\n",&i);
printf("&j\t=\t%p\n",&j);
printf("t\t=\t%p\n",t);
printf("m\t=\t%p\n",m);
getchar();
}