The C standard C99 allows inline functions and variable-length-arrays. So following functions are valid in C99 compliant compilers.
Example for inline functions
inline int max(int a, int b) { if (a > b) return a; else return b; } a = max (x, y); /* This is now equivalent to if (x > y) a = x; else a = y; */ |
chevron_right
filter_none
Example for variable length arrays
float read_and_process(int n) { float vals[n]; for (int i = 0; i < n; i++) vals[i] = read_val(); return process(vals, n); } |
chevron_right
filter_none
References:
http://en.wikipedia.org/wiki/C99
http://en.wikipedia.org/wiki/Variable-length_array
http://en.wikipedia.org/wiki/Inline_function
Recommended Posts:
- GFact 22 | (2^x + 1 and Prime)
- GFact 23 | (Brocard’s problem)
- 10 Web Development and Web Design Facts That You Should Know
- What is Cicada 3301?
- Interesting and Cool Tricks in Java
- How to Install and Configure MongoDB in Ubuntu?
- Interesting Facts About Perl
- 10 Interesting Facts About Computers
- Interesting Facts about DBMS
- Can C++ reference member be declared without being initialized with declaration?
- Facts and Question related to Style of writing programs in C/C++
- Dilworth's Theorem
- Storage of integer and character values in C
- Vantieghems Theorem for Primality Test
- Cauchy's Mean Value Theorem

