Links
Cannot find stdio.h (or other headers)
Install libc6-dev
Case insensitive str(n)cpy
#include <strings.h>
int strcasecmp(const char *s1, const char *s2);
int strncasecmp(const char *s1, const char *s2, size_t n);
xmalloc
void *xmalloc(size_t size) {
void *ptr = malloc(size);
if (ptr == NULL) {
fprintf(stderr, "%s: Virtual memory exhausted\n", progname);
abort();
}
return ptr;
}
xrealloc
void *xrealloc(void *ptr, size_t newsize) {
ptr = realloc(ptr, newsize);
if (ptr == NULL) {
fprintf(stderr, "%s: Virtual memory exhausted\n", progname);
abort();
}
return ptr;
}
C Operator Precedence
Operator - Description - Associativity
() - Parentesis - Left-To-Right
[] - Brackets
. - Object member
-> - Object member
-- ++ - Postfix increment/decrement
-- ++ - Prefix increment/decrement - Right-To-Left
- + - Unary plus/minus
! ~ - Logic negation/complement
(type) - Cast
* - Dereference
& - Address
sizeof - Get typesize
* / % - Multiply/Divide/Modulo - Left-To-Right
+ - - Addition/Subtraction
<< >> - Bitwise shift
< <= - Relation less/less or equal
> >= - Relation more/more or equal
== != - Relation (not) equal
& - Bitwise AND
^ - Bitwise XOR
| - Bitwise OR
&& - Logical AND
|| - Logical OR
?: - Ternary - Right-To-Left
= - Assignment
+= -= - Add/Sub assignment
*= /= - Mult/Div assignment
%= &= - Modulo / Bitwise AND assignment
^= |= - Bitwise (X)OR
<<= >>= - BITWISE SHL / SHR ASSIGNMENT