Out of fgets() and gets() which function is safe to use and why?


Out of fgets() and gets() which function is safe to use and why?

- The fgets() function is safer to use.

- It checks the bounds, i.e., the size of the buffer and does not cause overflow on the stack to occur.

- The gets() function does not check the bounds.

- The gets() function is an insecure and careless use can lead to errors.
Difference between strdup() and strcpy()
The function strcpy() will not allocate the memory space to copy. A pointer to the string to copy and a pointer to place to copy it to should be given.....
What is the difference between char *a and char a[]?
For char[] array, such size is not accepted by the compiler. If the size is specified, the following are the differences between char *a and char a[]......
Define void pointer
A void pointer is pointer which has no specified data type. The keyword ‘void’ is preceded the pointer variable......
Post your comment