Ive built an application that uses printf() to output data but the data ends up in a file named “stdout” instead of on the screen. Why?
The printf() and scanf() functions operate on the predefined stdout and stdin file streams. In a stand-alone Macintosh application, these streams are implemented as physical files in the Mac’s file system. Thus, anything written to stdout will end up in a file named “stdout”. Conversly, if you have a file named “stdin” in the same directory as the application, the contents of that file will be used to satisfy any read requests to the stdin stream. If you want the more traditional implementation of file streams, you should build your program as an SIOW application or as an MPW tool.
Related Questions
- Ive built an application that uses printf() to output data but the data ends up in a file named "stdout" instead of on the screen. Why?
- Although my instrumented application runs correctly, the coverage data file contains no information. What could be wrong?
- Excel output file: How do I divide the data of a single column into several columns?