hello all, I'm trying to duplicate a string array.
i created a function called duplicate but, when i run it, it gives me an error... what is wrong with it?
On line 45, the condition lenght2 should be i < lenght2
and on the next line it looks like copy is taking place in the wrong direction (copying from the duplicate to the original).
The duplicate is completely independent of the original. First string duplicateWords[5] allocates an array of empty strings. Then the loop copies the contents of each string, so the values are the same, but the address where it is stored will be different.