blob: 4326f11df8f6adad6269c154ea41e9f62b8641dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <stdio.h>
// A simple function definition
void hello() {
printf("Hello, world!\n");
}
// A function with parameters
int add(int a, int b) {
return a + b;
}
// A function returning a pointer
int* get_pointer(int* x) {
return x;
}
// A function declaration (prototype)
void declared_only(int x);
// A pointer to a function declaration
char* (*function_ptr_return)(int);
// A complex declaration
static inline const char* complex_func(const int* const ptr, void (*callback)(int)) {
return "complex";
}
int main() {
hello();
return 0;
}
|