Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Write formal proposal requests.

Answered: 1 week ago

Question

Write an effective news release.

Answered: 1 week ago

Question

Identify the different types of proposals.

Answered: 1 week ago