Which of the following is an example of a header file in C++?

Prepare for the ASU CSE100 Programming Exam with C++ Study Guide. Review flashcards, multiple choice questions, with hints and explanations. Master your exam!

The correct choice is a header file in C++. A header file typically contains function declarations, class definitions, and other symbolic constants that can be shared across multiple source files. In this context, "iostream" is a standard header file that provides functionalities for input and output in C++, specifically containing definitions for the standard streams like cin and cout.

While "main.cpp" and "myFunctions.cpp" are source files, which contain the actual implementation of the functions and the program's entry point, they do not serve the purpose of a header file. "variables.h" is also a valid header file format and could potentially contain declarations, but since it is not a standard library header file, it’s not what the question is looking for in terms of standard header files available in C++. Therefore, "iostream" is the definitive example of a widely recognized header file in C++.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy