stuff
This commit is contained in:
BIN
Examples/a.out
Executable file
BIN
Examples/a.out
Executable file
Binary file not shown.
20
Examples/proclayout.c
Normal file
20
Examples/proclayout.c
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* proclayout.c - Prints the location of variables stored
|
||||||
|
* at different locations in a process's
|
||||||
|
* address space
|
||||||
|
*/
|
||||||
|
#include <stdio.h> // needed for printf
|
||||||
|
#include <stdlib.h> // needed for malloc, free
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int j = 0;
|
||||||
|
int *k = malloc(sizeof(int));
|
||||||
|
printf("&main = %p\n", main);
|
||||||
|
printf("&i = %p\n", &i);
|
||||||
|
printf("k = %p\n", k);
|
||||||
|
printf("&j = %p\n", &j);
|
||||||
|
free(k);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
BIN
Notes/CS3841-04-Processes.pdf
Normal file
BIN
Notes/CS3841-04-Processes.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user