-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathhelloWorld.c
More file actions
20 lines (17 loc) · 769 Bytes
/
helloWorld.c
File metadata and controls
20 lines (17 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
int bss_var; /* Uninitialized global variable */
int data_var = 1; /* Initialized global variable */
int main(int argc, char **argv)
{
void *stack_var; /* Local variable on the stack */
stack_var = (void *)main; /* Don't let the compiler */
/* optimize it out */
printf("Hello, World! Main is executing at %p\n", stack_var);
printf("This address (%p) is in our stack frame\n", &stack_var);
/* bss section contains uninitialized data */
printf("This address (%p) is in our bss section\n", &bss_var);
/* data section contains initializated data */
printf("This address (%p) is in our data section\n", &data_var);
printf("\nAdd your name to the Python version.\n");
return 0;
}