In fact, the code is essentially C code... and it does not make much sense to try to convert as it to C#.
It will be much better to rewrite the program to uses managed types like strings.
A function like
removemultsign
should be rewritten as:
string removemultsign(string str)
{
return str.Replace("*", string.Empty);
}
And
insert
function can be written that way:
string insert(string str)
{
var builder = new StringBuilder();
foreach (var ch in str)
{
builder.Append(ch);
builder.Append("*");
}
if (builder.Length > 0)
{
builder.Remove(builder.Length - 1, 1);
}
return builder.ToString();
}
Other methods are left as an exercise for the reader...