Why should I have to inlude this syntax to c++ program?

Asked By 10 points N/A Posted on -

Hey techyv,

Why should I always have to include # include<iostream. h> and # include <string.h> on the first line of c++ program?


Answered By 0 points N/A #102416

Why should I have to inlude this syntax to c++ program?


# include<iostream.h> and # include <string.h>

Both are header files that contain definitions for in built library functions that can be used by our program. The iostream.h is a header file that contain definitions for the input/output stream. Thus whenever you need to take input and put output on your output terminal, you need to use this header file.

Again, when you use the string.h header, you get definitions for the string functions, like manipulating or creating strings. Some functions as getchar(), strconcat(), strcmp(), used for accepting a character from input, joining two strings, comparing two strings for equality respectively are well defined in the library files found with the compiler version. Thus all you do is that write the above statements to include header files and use the in built library functions.

Login/Register to Answer

Related Questions