So I save this main array in a temporal array. Then the main array I use '\0' to "delete" whats inside of it. At this point if i print the main array it will just print blank. But if then i use a for to like main array = temporal array. with x = 0 x < 4 x++, it does copy the four things from the other array but then it also prints what it had before i did the '\0'
Ive tried with a while an a counter but didnt work either. And ive used \0 before and it worked so idk why it isnt working now
for(int y = 0; y <= strlen(numeros); y++){
numeros[y] = '\0';
}
printf("%s\n", numeros);
for(int z = 0; z <= 4; z++){
numeros[z] = numerosTemp[z];
}
printf("%s\n", numeros);
My expected result was just the first four letters of the numerosTemp array but it comes with everything it used to have before i did \0. But in the printf that is after the \0 it does only print blanks so i dont understand why this is happening