Running a C++ Program during the execution of a C Program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • EricArmstrong
    New Member
    • Feb 2010
    • 2

    Running a C++ Program during the execution of a C Program

    Hello,

    This is my first time posting on this thread. I was just wondering if anyone had any idea if it is possible to call a C++ program inside the code of a C program.

    Also, I need to pass a few variables of the C program into the C++ program. I was also wondering if this is at all possible. I was thinking of just writing the variables to a file from the C program, and reading the variable from the C++ program. But it would be much easier to send them directly.

    Thanks!
  • EricArmstrong
    New Member
    • Feb 2010
    • 2

    #2
    Extra Information

    If it helps to know, I am running on Fedora 7 with a standard gcc compiler.

    I understand that there are shell commands that I can implement inside my C program, such as system calls, I am just not sure what those look like.

    At this point, I am leaning towards writing and reading my variables to a file that can be read by both programs.

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      Look up the standard library call

      system(const char *)

      in you documentation. You can put variable values on the command line.

      Comment

      Working...