This won't work for sending information to another application, because malloc allocates memory on your application's private heap, not in an area that is shared between applications. What you will need to do is look up shared memory or the equivalent for your operating system and maybe find out what other forms of interprocess communications are possible. If you don't know how much memory you allocated then perhaps it would be a good idea to extend the data structure to include enough information for the recipient to be able to work it out.