Accept command line options to use in the program

Assignment Help Computer Engineering
Reference no: EM132208456

Write a program in C++ that will accept command line options to use in the program.

Command line option 1 will be the program name.

Option 2 (if used) will be ‘-p' and that will print the keyword used in option 3.

Option 3 will be the keyword

Option 4 will be file input

Option 5 will be file output

Example:

with argv[2] (‘-p') ./test -p KEYWORD input.txt output.txt

without argv[2] ./test KEYWORD input.txt output.txt

So, recap, argv[2] (if used) will print argv[3] (KEYWORD).

If not used, the command line will just take name of program, keyword, input, and output file names.

Reference no: EM132208456

Questions Cloud

How the great recession was brought to an end : In the book of "How the Great Recession Was Brought to an End" written by Alan and mark, it said that "We estimate that the latter was substantially.
Draw the appropriate demand and marginal revenue curves : Explain in your own words why a seller in an oligopoly market (such as smartphones or domestic airlines), where mutual interdependence and rivals' responses.
Write a program in c which creates two child processes : Write a program in C which creates two child processes. Each child process should read a character from the keyboard and then write it to a single pipe.
A program to store the test grades in an array : Write a program in C++ that will ask the user to input 5 test grades. Store the test grades in an array.
Accept command line options to use in the program : Write a program in C++ that will accept command line options to use in the program. Command line option 1 will be the program name.
What is the maximum gst credit for the family : Consider a Canadian family of five - two adults and three children (age 5, 9 and 12). Currently there are two wage earners in the family - the husband's annual.
A prpgram to prompt the user for his or her first name : Write a program in C++.Prompt the user for his/her first name. Output the user's nickname. Use this algorithm to generate a nickname.
A program to implement two different searching techniques : Write a program in C++ to implement two different searching techniques: - Linear search - Binary search
Prompts you to enter a positive integer value or q to quit : Use "tail recursion" where a function calls itself as explained on page 356 to calculate the sum of all integers from 1 to the value entered.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Construct e-r diagram for a car insurance company

Construct E-R diagram for a car insurance company whose customers own one car or more cars each. Each car with it zero to any number of recorded accidents.

  Conduct some research to find a recent example of a change

If this aspect of your plan were not addressed, how would productivity, morale, or efficiency within the organization suffer? Support your reasoning with specific examples based on your scenario.

  Write a method called append that accepts two integer

Write a method called append that accepts two integer arrays as parameters and returns a new array that contains the result of appending the second array.

  Network design will support dial-up

Justify whether or not your network design will support dial-up or VPN remote access using descriptions of the following aspects: the advantages and disadvantages of the remote access solution, network protocols that will be used on your network, ..

  Provide an algorithm for constructing a tree-cpd

Provide an algorithm for constructing a tree-CPD that is the reduced tree reduced for a given context c.

  Discuss a home improvement project

Tell me about a project that you have been involved in. It does not have to be IT/Computer related. It can be any type of a project ex.

  Provide a write up on your understanding of application

What are the techniques you will account for when considering hardening solutions for application/OS security?

  Questionnewtown records has determined to store information

questionnewtown records has determined to store information about musicians who perform on its albums in a database.

  Develop a plan for estimating the project

Develop a plan for estimating the project. How long do you think it would take for you and three other students to complete the project? Provide support for the schedule that you propose.

  A program to generate a random noise of amplitude

Write a MATLAB program to generate a random noise of amplitude 0.2V_pp add it to a generated low frequency signal of 100Hz.

  What system design methodologies and techniques will you use

What potential risks do you see that may prevent successful completion of your solution design?

  Write a rule to find facts of who will be pinched

Write a rule (and then test it) to find facts of who will be pinched on Saint Patrick's Day for not wearing green.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd