Question: 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

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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!