2025-04-24 18:32:39 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
int a = 0;
|
|
|
|
int b = 40;
|
|
|
|
int c = 2;
|
|
|
|
|
2025-04-24 20:06:09 +02:00
|
|
|
// See: https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Nested-Functions.html
|
2025-04-24 18:32:39 +02:00
|
|
|
inline void lf(register int* r) {
|
|
|
|
a += *r;
|
|
|
|
}; // semicolon(;) not needeed!
|
|
|
|
|
|
|
|
/*
|
2025-04-24 20:06:09 +02:00
|
|
|
// Same as above... but need auto storage class if you pre-declare
|
2025-04-24 18:32:39 +02:00
|
|
|
inline auto void lf(register int* r);
|
|
|
|
inline void lf(register int* r) {
|
|
|
|
a += *r;
|
|
|
|
}; // semicolon(;) not needeed!
|
|
|
|
*/
|
|
|
|
|
|
|
|
lf(&b);
|
|
|
|
lf(&c);
|
|
|
|
|
|
|
|
printf("%d\n", a);
|
|
|
|
}
|
|
|
|
|