>segfaults
What's your excuse?
>>60103831
they're uninitialised...
>>60103831
>t. I don't have a clue about C
>>60103831
You literally have no clue how C works.
If you do int a;, then the data you get in a to start with is uninitialized, it could be anything. Well an int* holds a memory address. When you doint* a;the address that a holds could point literally anywhere, it's garbage data.
You need to doint* a = calloc(1, sizeof(int));, and then you need to re-read the first chapter of your C textbook
do this instead opieint main(){
int a;
int b;
int c;
*(&a) = 10;
*(&b) = 20;
*(&c) = 30;
return 0;
}
>>60103831
You're assigning the integer values 10, 20 and 30 to random memory locations that you don't own.
>>60103831
I don't like C but you are just plain retarded
>>60103831
>gcc 4.9.2
topfuckingkek
>>60103905
calloc? Why not use malloc?
>>60103964
pacman -Qi gcc
I was under the impression that C would also allocate space on the stack for the pointers values. I kind of forgot that it doesn't.
>>60103987
Just habit I guess. malloc would work as well, but calloc memsets it to zero before it returns it
>>60103964
That's nothing, the latest version of Centos has 4.8.5 and slitaz has 4.6.3
>>60104022
>calloc memsets it to zero before it returns it
Totally useless, especially if you initialize to something else just after.
>>60103831
C IS INSECURE AS DEMONSTRATED ITT
C IS FINISHED AND BANKRUPT
C BTFO