Function "between" for "Everything in One Line" library This is a function to determine if a number is between x and y. It is part of a library of mine called EOL or "Everything in One Line".

#include &lt;stdbool.h&gt;

#ifndef _WINDOWS_H
    #include &lt;windows.h&gt;
#endif

bool between (WORD n, WORD x, WORD y) { return (n &gt;= x &amp;&amp; n &lt;= y) ? (true) : (false); }
There's no need to use the conditional operator here. This would be enough:

bool between (WORD n, WORD x, WORD y) { 
    return n &gt;= x &amp;&amp; n &lt;= y;
}


Other than this, the variable names are not descriptive. It is not clear that x specifies the lower bound and y the higher bound.

bool between (WORD value, WORD low, WORD high) { 
    return value &gt;= low &amp;&amp; value &lt;= high;
}


Additionally, I have to question a little bit the usage for a "Everything in One Line" library. If the code that you are writing is trivial one-liners, it might be easier for other programmers to quickly re-write the actual code than to use your library. Most of the times I could use a between function, I would probably write the actual code in-line, without using an additional function for it at all. However, writing a "Everything in One Line"-library can of course be an educating experience for yourself.