hi thank you for replying but it keeps failing when I try debugging it. Ive tried trouble shooting it in many ways its not working. can you please help me with this.
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.
Thanx Nexius, but the code you wrote is doing nothing more then the one I wrote which is only displaying all the integers in the .txt file on the screen.
I need this program to display the decoded output using the char translate (int i) function.
<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
int main()
{
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
}
he returned an int instead of a char, the type before the function name, although I'm not sure if that would error considering an int can be represented as a char, still unexpected.