Which statement is incorrect include statement include looks

Which statement is incorrect? include statement, #include looks in the system defined directory for the file, file h. Windows PC and Macintosh users sometimes use call \"directory\") You can use #define to define a name for a symbol The include statement, #include -file. h\" looks first in the system defined directory for file. h then, if the file is not found, looks inthe user\'s current directory. Windows PC and Macintosh users sometimes \"folder for what I call \"directory\")Class, what must the constructors be named? A class is preferably written as two files: one interface (or include) file with the file with the file name extension of opp. Which of the following are the correct preprocessor commands necessary to prevent multiple inclusions of header files? #index HEADER_H # define HEADER_H//declarations for header.h go here #endif #indel HEADER_H//declarations for header.h go here #endif #define HEADER_H #indel HEADER_H//declarations for header.h go here #endif #include \"header.h\"

Solution

In the question number 13

The incorrect answer is the second option.

Reason:

Because #define cannot be use to define a name for symbol. It is used to assign predefined values for variables or constant values for variables.The value which is defined globally using #define tag are constants and cannot be chaged through out the execution of the program.

Example: If we are calculating the value of area of circle. The formulae is PI*r*r where PI is the constant value of 3.14. #define is used to add constant PI value to the memory during execution, in global declaration.The value of PI will not change and cannot be changed through out the program.

The declaration

#define PI 3.14

In the question number 14

The correct answer is option 4.

Reason:

The correct preprocessor command necessary to prevent multiple inclusions of header files is

#include HEADER.H .the other options contains wrong declarations namely #define which is used to define predefined values or constant values not a header file and #ifndef is used to prior declarataion of variables that are valued in the #define statement not to prevent inclusions of header files.

 Which statement is incorrect? include statement, #include looks in the system defined directory for the file, file h. Windows PC and Macintosh users sometimes

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site