source:
CIVL/mods/dev.civl.abc/examples/inner_func.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 323 bytes | |
| Rev | Line | |
|---|---|---|
| [aad342c] | 1 | // inner_func.c: example with inner function declaration. |
| 2 | // in C, the function entity should have "internal" linkage, | |
| 3 | // so the inner declaration refers to the same function defined | |
| 4 | // externally. | |
| 5 | #include <assert.h> | |
| 6 | int f(void); | |
| 7 | ||
| 8 | int main() { | |
| 9 | int f(void); | |
| 10 | int x = f(); | |
| 11 | ||
| 12 | assert(x==10); | |
| 13 | } | |
| 14 | ||
| 15 | int f() { | |
| 16 | return 10; | |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
