I am new to the c world and I want to merge two arrays into one array, i have one idea how to do this, but it doesnt work :P
char *s_one[] = { "Zorro", "Alex", "Celine" };
char *s_two[] = { "Zorro1", "Alex1"};
char *p = (char*)malloc((sizeof(s_one)+sizeof(s_two))*sizeof(char));
memcpy(p, s_one, sizeof(s_one));
memcpy(p + sizeof(s_one), s_two, sizeof(s_two));
//print out
for (count = 0; count < sizeof(p); count++)
printf("\narr[%d] = %c.", count, p[count]);
the output is just some random characters... what i am doing wrong, thanks in advance for every tipp
the output should be: Zorro Alex Celine Zorro1 Alex1