malloc doesn't do anything?
I just recently started programming in C.
I'm running into problems with Malloc. It seems like malloc doesn't do anything with my string?
I have the following code:
Why can I put a string in that is larger dan 5 bytes?
s = malloc( 5 * sizeof(char));
or s = "123456678";
printf("String is: %s", s);
I've tried many different ways and everytime I reserve a few bytes I can make the string larger.
Maybe i'm using things wrong but i would appreciate it if someone can explain to me why this works...