Scanset behaviour in scanf in C
You could expand your example a little bit and achieve your goal.
scanf("%[A-Za-z ]", s1);
Another way to do this would be:
scanf("%[^0-9]", s1); /* Scans everything until a digit */
You could expand your example a little bit and achieve your goal.
scanf("%[A-Za-z ]", s1);
Another way to do this would be:
scanf("%[^0-9]", s1); /* Scans everything until a digit */