50.4k views
1 vote
What header file must you include in a program using string functions such as strlen and strcpy?

A)
B)
C)
D)

User Bluray
by
7.6k points

1 Answer

2 votes

In a program using string functions like `strlen` and `strcpy`, you need to include the `<string.h>` header file.

The `<string.h>` header file is a standard C library header file that contains various functions and macros for manipulating strings. It provides function prototypes and declarations for functions like `strlen` (used to determine the length of a string) and `strcpy` (used to copy one string to another).

By including the `<string.h>` header file at the beginning of your program, you make these string functions available for use in your code. The functions and macros defined in `<string.h>` help simplify string manipulation and enable you to perform operations on strings more easily.

Please let me know if there is anything else I can help you with.

User Knobi
by
7.5k points