OiO.lk C++ Passing Parameters to a .c executed with execl in C
C++

Passing Parameters to a .c executed with execl in C


In C, if I use the execl command to execute another .c file, is there a way to pass parameters to this file that it can use during execution?

In my problem, I have C code that uses execl to execute an additional .c script. Once this script completes execution and returns its output (written to a file for context), control returns to the main file.

To avoid issues with the second script reading files, I’d like to perform as many operations as possible in the main code and then pass only the results to the second process via parameter passing. Is there a way for these two pieces of code to communicate?

execl("./script", "script", argcv[i], NULL);



You need to sign in to view this answers

Exit mobile version