I have to create a tester program for a C project (codetester.c). The user calls the program by executing:
codetester
or
codetester filename
How do I set up my project so that these commands can be executed?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Define your main function like
argcholds the number of arguments, this will be 2 for “codetester filename”.argvholds an array of char sequences;argv[0]will be “codetester” andargv[1]will be “filename”.