Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132928 views
License: OTHER
1
/* Example code for Think OS.
2
3
Copyright 2015 Allen Downey
4
License: Creative Commons Attribution-ShareAlike 3.0
5
6
*/
7
8
#include <stdio.h>
9
#include <stdlib.h>
10
11
int global;
12
13
int main ()
14
{
15
int local = 5;
16
void *p = malloc(128);
17
18
printf ("Address of main is %p\n", main);
19
printf ("Address of global is %p\n", &global);
20
printf ("Address of local is %p\n", &local);
21
printf ("Address of p is %p\n", p);
22
23
return 0;
24
}
25
26