subject

How would I start to build a header file in c++? Instructions: Add a new C++ header (.h) file to your program and in it please declare an enumeration for the different array indices that are relevant to your program (e. g., the program name which is at position 0 in argv, the input file name which should be given at position 1 in argv, and the expected number of command line arguments including the program name, which is given by argc).

In that same header file, declare an enumeration for the different success and failure values your program (and functions called within it) can return (i. e., 0 for success and different non-zero values for all the different kinds of failures the program may encounter).

Include that header file in your main program source file and in any other source file that has functions with non-void return values, or that needs to use indexes into the array of command line arguments to the program, and throughout your program please use the labels you declared in the enumerations, instead of hard-coding numeric values like 0, 1, 2, etc.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Selling a product through an electronic medium is
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
How often does colleges update the cost of attendance on their website? . a)every two years b) every four years c) every year d) every semester
Answers: 1
You know the right answer?
How would I start to build a header file in c++? Instructions: Add a new C++ header (.h) file to y...
Questions
question
Mathematics, 26.10.2020 22:20
question
Mathematics, 26.10.2020 22:20
question
Mathematics, 26.10.2020 22:20
question
Health, 26.10.2020 22:20