3 ms·
> but there is no direct way to know if a variable is local or not (in C and C++ at least). If you only have one stack, and the stack is at the top of memory a
by geocar 10y ago
> but there is no direct way to know if a variable is local or not (in C and C++ at least).
If you only have one stack, and the stack is at the top of memory and it grows down, you can:
int onstackp(void*x){char a;return x>&a;}
- vmorgulis 10y agoThat's so simple! Thank you a lot.