Adrenachrome said:
This thread just simply does not deliver, I demand substance!
|
weed meth is a subtance
not but really...ok like maybe i can post a C toturial while im drunk
ok likew
wee have variables
and they relalocated opn the stack
int c;
int d'
takes up like 8 bytse of space on 32-bit x85
per function of course you fucking idiot
but if you use malloc() we can alocate liek any amount on the heap
which is RAM you fucking idiot
and its managed by the OS
thats why its inpractcal to write an OS in C++
they are written in C
you fucking retarded motherfucking idiotici cunt
ok
so malloc returns a void*
but you can cast to any type you like, and its automatically aligned for your processor
which means you can adress any type you like (a POINTER though)
liek void* int* long* anything
int* i = malloc(sizeof (int))
but in C++ you need to cast
(that whgy the language sux)
int* i = (int*) malloc(sizeof(int))));
ok
thats your first leson