hi.
I am writing a program to copy a string without using the strcopy funcion.
I am copying from a to b, but I am not able to delete from b to be ready for another input.
I have tried numerous ways, both with for loop and delete []b but nothing seems to work.
A copy operation that kills the source object would not be a copy.
> but I am not able to delete from b to be ready for another input.
You do not need to do anything prior to a reading.
If you do want for b to be considered "empty" then you could simply b[0] = '\0';
Only delete what you new
Only delete[] what you new[]
Also, it is obvious that line 28 has no effect, as it is modifying a pointer local to the function.
If however i would have used it like I started to how would would that be presented and how to get the null-terminated copied over as well. It seems that was my problem.