Computer Science, asked by EnzoThangzawm4191, 10 months ago

List the various functions that be used for perform the i/o of the string data

Answers

Answered by abhijeetkr9990pekgyq
1

Before knowing about the functions used to perform I/O of string data, it is important to remember that string in C is implemented in the form of character array (or char array).

The various functions that can be used to perform input/output of the string data are:

•gets() : This function is used to input a string value. However this function is discontinued in C11. Since it doesn't consider the maximum capacity of the character array (i.e. string) and could lead to overflow errors during runtime.

•scanf(): This function is also used for the same purpose. However, it inputs the string value only upto the occurrence of the first blank space(or only upto the first word).

•fgets(): This function is highly similar to gets() function but it fixes the Overflow problem in the original function by taking the maximum limit of the array as a parameter.

Similar questions