Your question is unclear. Please clarify the following:
1. Do you want to print the word in reverse or vertically?
2. Do you want that done when the user enters 1 or 2?
Away from that you need to answer and correct the following:
1. Why are you including <fstream>? I can't see you using any file streaming and you don't need to for this assignmnet.
2. In your switch block there is this wrong line:
void printVertically(string name, int i);
You need to remove the voidword to call the function. You can't redeclare the function when you call it. The compiler won't allow this illogical behavior. You also need to remove the word string for the same reason. You also need to remove that int i because you are not using any i from outside the function. That means that you need to have the following as a function prototype:
void printVertically(string name);
3. Why do you have the following varaibles in the main program? Remove these:
Oh, regarding the length() vs size() thing: size() is an alias for length(). They both do the same thing. Just make sure that you use it as a method, not a data member. That means rewriting that forloop in your printVertically function definition as: