Using Dev-C++, I want to delete a character in array. I don't know what to do next.
Code:
include <iostream>
using namespace std;
int main ()
{
char word[3];
char target;
int hit;
hit=0;
cout << "Enter 4 letters" <<endl;
cin >> word;
cout << "Enter letter to delete" <<endl;
cin >> target;
for (int x=0;x<4;x++)
{
if (word[x]==target)
{
hit=1;
}
if (hit==1)
{
word[x]=word[x+1];
cout << word <<endl;
x++;
}
else
{
cout << "No match letter to delete" <<endl;
}
}
system ("pause");
return 0;
}
Sorry for being noob. I can study and understand your answer.