So i want to replace letters to adaptate my letter language, i made a program but when it replaces letters it replaces letters multiple times for example :
when i write "oro"
the output is "araataara"
it should be "ata"
r isn't replacing with t, only t is being replaced with r
So it is not quite clear what replacements you want. If you want to replace 'r' with 't' and 't' with 'r' in the same string you can't do it like this.
if you are using char, and there is more to it than 10 or so letters, you can also make a lookup table.
char tbl[256];
for(int i = 0; i < 256; i++)
tbl[i] = i; //can use iota and fancy stuff here instead.
ok, now tbl is the ascii table (extended).
now make the changes you want one time:
tbl['r'] = 't';
tbl['t'] = 'r';
...
for all the letters in your string
string[index] = tbl[string[index]]; //inefficient, it replaces say e with e if you didn't change e to something else, but it keeps the code smaller/ simpler.