If I don\'t know how long the word is, I cannot write char m[6];, The length of the word is maybe ten or twenty long. How can I use scanf to ge
char m[6];
scanf
Take a character pointer to store required string.If you have some idea about possible size of string then use function
char *fgets (char *str, int size, FILE* file);`
else you can allocate memory on runtime too using malloc() function which dynamically provides requested memory.