P
pkirk25
If I start a function with this:
char *temp_string = malloc(MAXLEN);
char *item_id_string = malloc(MAXLEN);
char *item_description_string = malloc(MAXLEN);
Can I assume that malloc does exactly as its told or so I need to
check?
When the function finishes, it the memory freed up or do I need to
explicitly call free(temp_string) at end and free(item_id_string)
free(item_description_string ) after I am finished with them?
I can tell these are newbie type questions but K&R is very terse on
this subject.
char *temp_string = malloc(MAXLEN);
char *item_id_string = malloc(MAXLEN);
char *item_description_string = malloc(MAXLEN);
Can I assume that malloc does exactly as its told or so I need to
check?
When the function finishes, it the memory freed up or do I need to
explicitly call free(temp_string) at end and free(item_id_string)
free(item_description_string ) after I am finished with them?
I can tell these are newbie type questions but K&R is very terse on
this subject.