Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

0
Posted

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?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123