Fetching structure value from one C file to other both C files are different Exec.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prakharv
    New Member
    • Oct 2006
    • 9

    Fetching structure value from one C file to other both C files are different Exec.

    Hi All,

    I have written a small C code in which I am storing some values in structure at run time.And this C file in turn calling another C executable, In this executable
    I want to fetch the structure data what I have stored earlier.

    Please, can anyone explain me how to do this in C.

    eg: First.c- Stores the value in a structure.And it calls another c executable at run time called second.c. And ,

    Second(Another Executable) - Wants to read the data stored by First executable in a structure.

    Please explain me............

    Regards
    Prakhar
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #2
    Originally posted by prakharv
    Hi All,

    I have written a small C code in which I am storing some values in structure at run time.And this C file in turn calling another C executable, In this executable
    I want to fetch the structure data what I have stored earlier.

    Please, can anyone explain me how to do this in C.

    eg: First.c- Stores the value in a structure.And it calls another c executable at run time called second.c. And ,

    Second(Another Executable) - Wants to read the data stored by First executable in a structure.

    Please explain me............

    Regards
    Prakhar
    I assume these are seperate executable .exe programs? If so the simplest way is for the first program to write the data to a file using binary IO and the second to read it using binary IO. see the section on binary files in
    http://www.codeproject .com/string/bstrsproject1.a sp

    Comment

    Working...