Due to server problems the website is temporarily offline! Visit http://www.smorgasbordet.com/pellesc/ to download Pelles C.
#define __STDC_WANT_LIB_EXT1__ 1#include <stdio.h>int main(void){ char temp[10] ; if (gets_s(temp,10) == NULL){ printf("Error reading input\n"); } printf("%s",temp); return 0;}
dst shall not be a null pointer. max shall neither be equal to zero nor be greater than RSIZE_MAX. A new-line character, end-of-file, or read error shall occur within reading n-1 characters from stdin. If there is a runtime-constraint violation, dst[0] is set to the null character, and characters are read and discarded from stdin until a new-line character is read, or end-of-file or a read error occurs.
The gets_s function reads at most one less than the number of characters specified by nfrom the stream pointed to by stdin, into the array pointed to by s. No additionalcharacters are read after a new-line character (which is discarded) or after end-of-file.The discarded new-line character does not count towards number of characters read. Anull character is written immediately after the last character read into the array.