I'm trying to make something that compiles and runs .c files in one command. But I'm having a problem. I got the filename through the get_string(); under the_ cs50.h_ library.
And now I'm to give the system()
function this command make {filename}
by doing this
system("make %s", filename")
But it just gives this error back:
mac.c:18:23: error: too many arguments to function call, expected single argument '__command', have 2 arguments
system("make %s", filename);
~~~~~~ ^~~~~~~~
I understand that It means that the system()
function has too many arguments but I don't know any other way to add in the filename after make.
Here is a copy of the code I am using if you need to look at it more. Thanks! Click Here to go to the github page If you find a fix, either comment it or you can do a pull request at the github!