What does the ? operator provide?
Can be used for a shorthand for if-else in an expression.
e.g
condition ? expression if true : expression if false;
or
max = (a > b) ? a : b;
How is a string represented in C?
An array of chars terminated by the NULL character ‘\0’
Compiler adds 0 at end of array so make length of array big enough
What is #ifdef?
A preprocessor directive which include some code only if a symbol is defined e.g #ifdef X .. #else .. #endif
Why use macro functions?
* Useful for things which aren’t valid code
What is a header guard?
#ifndef POINT_H_
#define POINT_H_
typedef struct { int x, y } point;
#endif