I have never used C++ before and my professor said this is supposed to be "very simple", but I can't figure it out. This is what I have so far:
#include <iostream>
#include <cstdio>
#include <cstdlib>
int main(int argc, char *argv[])
{
char command[50];
if (argc==2)
system(command, "./findName.sh", argv[1]);
}
return 0;
My shell script works when I run it by itself but I am not sure how to use a C++ program to run it. For the shell script, the user is supposed to enter a user ID like this:
./findName.sh userID
and the program returns the person's name from a file of names and user IDs like this:
LastName, FirstName
For the C++ program, it needs to pass the information the user enters to the shell script and return the same results.
As I said, I have never used C++ before so I don't know if any of this is right. It is a mix of things I have found online. Thank you for all of your help!!