Excellent. TIL about std::getenv(.). Thank you very much. This works.
FWIW, I had been trying the path from the root directory without success:
outFile = "/Users/me/myfile.txt";
If you "cd /" at a Unix prompt, you will see the Users folder and you can cd there with this path. However, getenv("HOME") returns "/Volumes/myVolume/Users/me". Setting this as the absolute path also works.