We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Compilation: Types

You're probably familiar with the idea of types from Python, but C does them quite a bit differently.

In Python, it's OK (but still disgusting) to change the type of a variable:

x = 12345
x = "wow, a new type"
x = False
x = None
x = "ok a string again :'("

In C, changing the type of an existing variable is not allowed:

int main() {
    char *max_threads = "5";

    // call badcop
    // this is illegal
    max_threads = 5;
}