subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
How is the number 110 written when expanded out to place values in the base 2 (binary) number system? options: 2 x 4 + 3 x 2 + 4 x 1 1 x 2 + 1 x 2 + 0 x 2 1 x 100 + 1 x 10 + 0 x 1 1 x 4 + 1 x 2 + 0 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
Why were most movies from the late 1890s until the early 1930s only filmed in black and white? there were only a few people who could afford the technology to produce color motion pictures back then. audiences did not want color motion pictures until later. the film used to make color motion pictures often overheated, which was a safety hazard, so it was generally not allowed. color films had to be hand-colored, frame by frame.
Answers: 3
You know the right answer?
This assignment will introduce how to incorporate command_line arguments into your program. Until no...
Questions
question
Mathematics, 16.01.2021 16:30
Questions on the website: 13722363