I dont know what the for function is for.
for (int pos = 0; pos < message.length(); pos++) //What does this part do?
In C Programming Language, for() is not a function();; it is a Control Structure. A function has a name (called identifier) which must not be a keyword. for is a keyword; therefore, it cannot be a function name.