title: Transfer of control and data between C and C#
body: <p>C# main program needs to call a C program GA.c This C code executes many functions and one function initialize() calls objective() function. But this objective function needs to be written in C#.This call is in a loop in the C code and the C code needs to continue execution after the return from objective() until its main is over and return control
  to C# main program.</p>
  
  <pre><code>C# main()
  {
    //code
  
    call to GA in C;
    //remaining code;
  }
  
  
  GA in C:
  
  Ga Main()
  {
  
   //code
   call to initialize function();
   //remaining code
  }
  
  
  initialize function() in GA
  {
  
   for(some condition)
   {
     //code
     call to objective(parameter) function in C#;
     //code
    }
  }
  </code></pre>
  
  <p>How do we do this? </p>