I need to create a string on the heap, I was wondering if there is something similar already included in the standard libraries, or do I have to implement it myself (using malloc())?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use
malloc(),calloc()orstrdup()(the latter is POSIX, not standard C).It is not totally clear what you mean by “implement it myself (using
malloc())” — what exactly is there to implement?