I have to put a string into another without \0, I tryed a lot of ways but the string is always dirty.
char string[100];
int pos=0;
fgets(string, 99, stdin);
len = strlen(string);
printf("%d\n", len);
char array[len-1];
for(pos=0; pos<(len-1); pos++)
{
array[j]=string[pos];
j++;
}
printf("%s", string);
printf("%s", array);
In the terminal I have: dogs dogs(ENTER) 10(ENTER) dogs dogs(ENTER) dogs dogs@
I also tryed to remove \0 using another symbol but it can't see '\0' or '\n', help me plz!