First of all you need to read the string from the user. So you want a function for it. I suggest you using fgets function.
fgets - C++ Reference
After all you need to make your process in your string. So you can declare a variable with the appropriate position (here the position is 4)
Code:
#define POS 4
int position = POS;
every POS-ed times you will put the 'X' character in your string. Make a loop that increase its iteration value every POS-ed times. In the body of this loop you can replace with the 'X' character.
Code:
array_that_hold_your_string[i] ='X'; // i +=POS
Note that I am using a directive in order to make the POS. Doing this is a good programming practice if you want to change the position in the future for example if you want to replace the 8th character and then the 16th and so forth in your string. The only thing you need to do is to change the number 8 for example and this number will be changed to all points that use the POS in your program.