I am trying to create a simple function that double the characters inside of a string and outputs the new string. Ex. "hello world" would become "hheelloo wwoorrl
using namespace std; string doubleChar(string str) { string newString(str.size() * 2, '\0'); for(int i =0;i
The length of result should be set twice of the input. And index should be multiplied by 2.