// these are the errors that I'm getting from an online c++ compiler
// main.cpp:4:10: error: #include expects "FILENAME" or
// main.cpp: In function 'void permute(char*, int)':
// main.cpp:17:9: error: 'f' was not declared in this scope
// I don't understand how to print full_string to a file!
// otherwise, I know that it gives the correct output -- 90 strings.
// thanks for any/all help in advance. Bill
Exactly: It's defined in main.
But your function "permute" knows nothing about it.
You should pass it as a std::ofstream& parameter for "permute".
Remember to keep your "&". It means a reference, the parameter won't be copied and will be kept as in int main().
so, in "main", the statement... permute(full_string, 6); should read... permute(full_string, 6, std::ofstream& f); and the "permute" function should read... void permute(char *str, int length, std::ofstream& f), and then the function will recognize "f" ??? thanks, mille grazie! also, do I really have to have the "#include >ios>" ???