36 lines
586 B
C
36 lines
586 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
auto int a = 0;
|
|
int b = 20;
|
|
int c = 1;
|
|
int d = 0;
|
|
|
|
// See: https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Nested-Functions.html
|
|
inline auto void lf(register int *r) {
|
|
a += *r;
|
|
int s = a + *r;
|
|
inline void deepfun() {
|
|
s *= 2;
|
|
}
|
|
|
|
deepfun();
|
|
d += s;
|
|
}; // semicolon(;) not needeed!
|
|
|
|
/*
|
|
// Same as above... but need auto storage class if you pre-declare
|
|
inline auto void lf(register int* r);
|
|
// ...
|
|
inline void lf(register int* r) {
|
|
a += *r;
|
|
}; // semicolon(;) not needeed!
|
|
*/
|
|
|
|
lf(&b);
|
|
lf(&c);
|
|
|
|
printf("%d .. %d\n", a, d);
|
|
}
|
|
|