Top "Stdio" questions

This tag is for questions regarding "Standard I/O", i.e. I/O using the facilities in the C header <stdio.

What's the best way to return a random line in a text file using C?

What's the best way to return a random line in a text file using C? It has to use the …

c file random stdio
fputc vs putc in C

I was reading the C programming book by Kernighan and and came across putc and fputc. I didn't quite understand …

c stdio
C equivalent of autoflush (flush stdout after each write)?

In Perl, I can type: $|++; and anything printed to STDOUT will be automatically fflush()ed. Is there an equivalent in …

c stdio
Java: how to abort a thread reading from System.in

I have a Java thread: class MyThread extends Thread { @Override public void run() { BufferedReader stdin = new BufferedReader(new InputStreamReader(System.…

java stdio
Is there a Windows equivalent to fdopen for HANDLEs?

In Unix, if you have a file descriptor (e.g. from a socket, pipe, or inherited from your parent process), …

c winapi stdio
popen implicitly declared even though #include <stdio.h> is added

This is tiny snippet of my code. #include <stdio.h> #include <unistd.h> #include <stdlib.…

c declaration pipe implicit stdio
Does sprintf/snprintf allocate additional memory?

I'm writing a library and want to make it absolutely resource-agnostic which also means that library should live with user-supplied …

c memory-management stdio
ftell at a position past 2GB

On a 32-bit system, what does ftell return if the current position indicator of a file opened in binary mode …

c file-io c99 stdio ftell
Using fopen() in Objective-C

I am puzzled by a crash I keep getting due to an error at this section of code: FILE *fid200; …

c++ objective-c ios fopen stdio
Concurrent/Non-blocking console keyboard input

I'm working on a MUD in java. I read player input every tick, but I'm using Scanner which uses blocking …

java input textinput stdio