|
|
@@ -65,6 +65,28 @@ Okay, now we're left with following actually useful and C-loving keywords, 18 of |
|
|
|
- return: Used in functions to return from them with or without a result (return value). It's best when function only uses it once. |
|
|
|
- break: When inside a loop, this statement will exit the loop. In newer standards it can take simple arguments, but we'll see why that's bad. |
|
|
|
- continue: Even more specific case, when inside a loop, this statement will skip to the end of the loop, and then continue again. |
|
|
|
|
|
|
|
Now, of those 18 actually useful C keywords, I like to avoid 'struct', 'switch', 'case', 'default', 'while', and use (functional) 'static' and 'extern' only in order to silence |
|
|
|
compiler warnings, 'static' inside a function is more useful. That leaves us (me) with 12 C keywords that I love, out of complete 32 keywords in ANSI C standard. However, we'll |
|
|
|
see that sometimes is preferable to use switch statement somewhere, or while loop when for loop feels like overkill. In most real-world cases, you'll need to use some API or |
|
|
|
library that internally used structures everywhere, so you'll need to adapt to it, we'll see examples later... |
|
|
|
|
|
|
|
So, real men need these keywords { char, int, void, sizeof, static, if, else, for, enum, return }, and use the rest of them in order to silence compiler warnings, use some |
|
|
|
standard library functions, clean the source code or access an API / library / header file. |
|
|
|
*/ |
|
|
|
|
|
|
|
extern int character_is_uppercase (char character); |
|
|
|
extern int character_is_lowercase (char character); |
|
|
|
extern int character_is_digit (char character); |
|
|
|
extern int character_is_blank (char character); |
|
|
|
extern int character_is_alpha (char character); |
|
|
|
extern int character_is_symbol (char character); |
|
|
|
extern int character_is_visible (char character); |
|
|
|
extern int character_is_invisible (char character); |
|
|
|
extern int character_is_escape (char character); |
|
|
|
extern int character_is_underscore (char character); |
|
|
|
extern int character_is_hexadecimal (char character); |
|
|
|
|
|
|
|
extern int character_compare_array (char character, char * character_array); |
|
|
|
|
|
|
|
#endif |