Created by jyn with reveal.js
Don't worry if you don't know these words yet
(demo goes here)
#include
— C doesn't have imports, it just puts an entire file inside of your file#define A 1
— for when you want to be sure things are inlined#ifdef
— conditional compilationpublic
/private
,
static
is the poor man's private
Pointers hold the address in memory of a variable
int f(int i) {
i = 1;
}
int f(int *p) {
*p = 1;
}
int main() {
int a[] = {1, 2, 3};
int i;
// these are all equivalent and set i to 1
i = a[0];
i = *a;
i = *(a + 0);
i = *(0 + a);
i = 0[a];
// this will not compile
i = a; // error: assignment makes integer from pointer
}
(a, b)
(demo goes here)