Skip to content

Instantly share code, notes, and snippets.

@pkutaj
Created April 20, 2026 07:21
Show Gist options
  • Select an option

  • Save pkutaj/3406e64a86b430ee3ca9849bbde5a503 to your computer and use it in GitHub Desktop.

Select an option

Save pkutaj/3406e64a86b430ee3ca9849bbde5a503 to your computer and use it in GitHub Desktop.
CTJ-46: The Stack snippet
#include <stdio.h>
void z_func() {
int x = 10;
printf("&x = %p\n", (void*)&x);
}
void y_func() {
int x = 10;
printf("&x = %p\n", (void*)&x);
z_func();
}
void x_func() {
int x = 10;
printf("&x = %p\n", (void*)&x);
y_func();
}
int main() {
int x = 10;
printf("&x = %p\n", (void*)&x);
x_func();
return 0;
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment