I\'m trying to build an instruction pipeline simulator and I\'m having a lot of trouble getting started. What I need to do is read binary from stdin, and then store it in me
Consider using SET_BINARY_MODE
macro and setmode
:
#ifdef _WIN32
# include
# include
# define SET_BINARY_MODE(handle) setmode(handle, O_BINARY)
#else
# define SET_BINARY_MODE(handle) ((void)0)
#endif
More details about SET_BINARY_MODE
macro here: "Handling binary files via standard I/O"
More details about setmode
here: "_setmode"