Calling a function in cpp file inside shell script

Hi I need to call a function written in a cpp file with arguments inside the shell script..Can anyone help me how to do this:(

Do you have a .h file the defines a function prototype and classes exported by the cpp file?

You will need to write another cpp file with a main() function that collects the command line arguments passed from the shell then calls the function and returns an exit code back to the shell.

Compile this main cpp and link a compiled .o file from the cpp file use c++ -c fn_file.cpp to compile the cpp file.

1 Like