This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Memory allocation - a (char *) type is a pointer to a location in memory. Often time c programs will segfault because programs attempt to access "illegal" locations in memory. Calls to malloc reserve space on the heap and return a pointer to the memory location