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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started