Skip to content
Related Articles
Open in App
Not now

Related Articles

G-Fact 6

Improve Article
Save Article
  • Difficulty Level : Medium
  • Last Updated : 22 Mar, 2017
Improve Article
Save Article

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;
    return b;
a = max (x, y); 
  This is now equivalent to 
  if (x > y)
    a = x;
    a = y;

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);


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!