Computers and Technology

This assignment will introduce how to incorporate command_line arguments into your program. Until now, if we wanted our program to get data from a user, we had to ask the user for specific input and then capture that input with scanf(). In many cases, we would like the user to enter data at the same time they run the program. For example, when we use the "cp" command to submit our programs, we enter the program name (i. e. cp) along with the file to copy and where to copy it. For example: cp p5.c /home/faculty/skoss/cse121/your_UID
So this assignment is about writing a little utility program called submit, which will make it easier for you to submit your weekly programs. After you create this utility, you can simply type submit, followed by your px. c, and it will be copied to your directory in my account.
For example, to submit p5.c you would type:
./submit p5.c Below is the code for this utility. When you compile it, use the following command: goc extra1.c -o submit
#include #include You need to put int main (int argc, const char *argv[]) "Your Login ID here. char cmd (100); //buffer to hold cp command char path() = "/home/faculty/skoss/cse121/your_lo gin_ID"; sprintf(cmd, "cps ", argv[1], path); system(cmd); // gives the cmd command to the operating system for // execution return 0; To learn more about the functions "sprintf()" or "system()". you can google or man_page them, sprintf() is declared in and system() is declared in

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 12:50, michaelchavez6959127
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks. requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
image
Computers and Technology, 24.06.2019 08:00, qveenvslayin
How can smart devices benefit businesses, organizations, and social communities in the global marketplace?
Answers: 1
image
Computers and Technology, 24.06.2019 08:10, anthonysutton82
Where are american poets found in the dewey decimal system
Answers: 1
Do you know the correct answer?
This assignment will introduce how to incorporate command_line arguments into your program. Until no...

Questions in other subjects:

Konu
English, 05.11.2020 07:20