added gcc example for inner-function definitions and declarations with the "auto" keyword
This commit is contained in:
parent
2579b4f105
commit
c40c4d035b
25
innerf.c
Normal file
25
innerf.c
Normal file
@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int a = 0;
|
||||
int b = 40;
|
||||
int c = 2;
|
||||
|
||||
inline void lf(register int* r) {
|
||||
a += *r;
|
||||
}; // semicolon(;) not needeed!
|
||||
|
||||
/*
|
||||
// Same as above...
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user