and i want to replace every "?" with a double value which i m converting as string. But I am facing a problem as it only picks up the first character.
for example:
I have to replace "?" with "0.987654321" but its only picking the first character "0".
you are right, line[i] is a single character of string.
This code is just a sample, actual code is very big file, cant fit in here.(i have modified the code)
So i am trying to explain the problem....
I am reading from the file line by line.....and every line is similar to what i have shown above (containing "?"). I have to replace every "?" with a double value.
So i am converting every double value into string and then trying to replace "?" with that string value(converted from double value).
the problem i am facing is... it is only reading the first character.
I have tried this solution but the string line is actually coming from another file, there are many rows like that.
I cant copy it to temp as i am using the same string in the program further as well.