+ 2
(C) How to use strcat across functions
Hello, I am wanting to use stcat to add strings across functions to the one string using pointers. I have been unable to figure out how to do this. In the attached code I have made an attempt to do this. What I want it to do is change the string in the main function using the helper functions - allowing me to carry the string across functions Please help! https://code.sololearn.com/ce2JRSvZ4D2t
3 ответов
+ 4
This is an implentation of Ani Jona 🕊 reply.
https://code.sololearn.com/c26Urgb3zqM7
+ 5
To begin with, you need to pass a pointer to char, which is C's version of a string type. Secondly, you need to make sure that the target array is allocated large enough to hold all concatenated parts.
+ 3
Thank you so much!