Hello! I've written this code to erase all the spaces in a string, but it doesn't work if i type "a d f s f aa f" in ex.in. Can anyone help me solve this problem?
oh yea Ive been there, kinda sucks. Unfortunately I have no idea how to do it manually or whatever its called, the way you're trying it. Ive seen some solutions on youtube/google, but they require two different character arrays, or character pointers. Are you allowed to do that?
for(i=0;s[i]!=0;i++)
You want to be checking for '\0' and not 0. You may also want to make sure that i < 1001 in case for some reason the check didn't work.