Assuming you are trying to take a whole text document into a string, I've taken the liberty of making a prototype program that does this for you.
Mind the extra parenthesis at document declaration, as it's needed for proper parsing.
<type> functionname (<input type> local variable name)
return variable of <type>
1 2 3 4
int doubler (int i) // this function has to return an int, and has to be given an int
return i * 2; // return double of int given
1 2 3 4 5
std::cout << doubler(2) << std::endl; // will output 4
return 0; //0 is success, anything else is failure, main always returns an int, although your compiler will normally add this if you don't