Is there a way to do this in C (or C++)?
Background info: I'm going to be reading either a memory block or a large file line by line and processing those lines one at a time and I'm lazy to write the same thing twice, once for memory blocks and once for file streams. If the file stream version needs to be used, then the file won't fit into memory. Understandably, I could save the memory block to a file, and then access the same data with a file stream, but that seams like a waste of computer time.
I know about /dev/shm on linux systems. Is there something more portable that gives me the same kind of abstraction at the layer of the language (C or C++)?