Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download

📚 The CoCalc Library - books, templates and other resources

Views: 96108
License: OTHER
1
#include <stdio.h>
2
#include <stdlib.h>
3
4
int seconds;
5
6
int main (int argc, char *argv[])
7
{
8
int i = 0;
9
10
if (argc == 2) {
11
seconds = atoi (argv[1]);
12
} else {
13
printf ("Usage: sleep [duration in seconds]\n");
14
exit (-1);
15
}
16
17
printf ("Address of seconds is 0x%.8x\n", &seconds);
18
printf ("Value of seconds is %d\n", seconds);
19
20
sleep (seconds);
21
22
printf ("Address of seconds is 0x%.8x\n", &seconds);
23
printf ("Value of seconds is %d\n", seconds);
24
25
26
}
27
28