add char array into another char array

hello,

the question is how to add char ca and char cb into char c?
//char c {'0','1','2'} = char ca{'0'} + char cb{'1','2'}

tnx


If you have
1
2
3
char ca[] = {'0'};
char cb[] = {'1', '2'};
car c[3];

to make c = ca + cb, you have to copy all elements of ca to the beginning of c and all elements of cb immediately after those. If the arrays were 0 terminated, you could use strcpy and strcat, but now you write the for loops yourself.
Topic archived. No new replies allowed.