S
S
SashaN692021-12-13 18:59:29
C++ / C#
SashaN69, 2021-12-13 18:59:29

How to concatenate an array of strings into one string and separate them with spaces?

How to concatenate an array of strings into one string and separate them with spaces?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-12-13
@SashaN69

If this is C++ and you are using std::string, then you can stupidly sum the strings through += .
If, according to the condition of the assignment, you need to do everything by hand, then you need to allocate memory so that everything fits, and then you can use strcat_s , memcpy , or even copy character by character.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question