C Tutorial/printf scanf/scanf scan set
Using a scan set
#include <stdio.h>
int main()
{
char z[ 9 ];
printf( "Enter string: " );
scanf( "%[aeiou]", z );
printf( "The input was \"%s\"\n", z );
return 0;
}
Enter string: 3 The input was ""