/* File: scan3.c More pattern matching using scanf */ #include main() { int r ; char str[11] = "foo" ; printf("Enter an alphabetic string: ") ; r = scanf("%10[a-zA-Z]", str) ; printf("r = %d, str = \"%s\"\n", r, str) ; }