gets: reads characters from stdin
//Header file: #include <stdio.h>
//Declaration: char *gets(char *str);
//Return: a null pointer on failure.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char fname[128];
printf("Enter filename: ");
gets(fname);
printf("%s \n", fname);
return 0;
}
/*
Enter filename: 321
321
*/
Related examples in the same category