Using C, how can I access the same block of memory as another C program?
So, I'm on hour one of learning C. Maybe I'll jump over to C++ tonight.
I'd like to create two command line programs using C that can "talk" to each other. The first thought that came to mind is to transfer information between the two by writing to and polling files. However, I figure C provides all the methods I need to directly allocate memory and access it, and that would be much faster and more sensible technique.
Can someone provide an example or advice?
What you are asking for is called shared memory. Unfortunately, shared memory is not part of the C language per se, but a feature of the operating system. Since you didn't specify what operating system you are using, I point you to a Unix SysV shared memory tutorial.