Hi,
I'm trying to convert an int to a char, just to see if the value entered is a alphabetic character. Here's what I have in my method:When scanf reads a letter into x, though, it just loops endlessly. How can I detect if the value entered is a character, and then print something if it is?Code:void FillUserArray( int userArray[], int arraySize ) { int i = 0; //array indexer int j = 1; //counter for output format int x; //holders for user input while( i < arraySize ) { printf( "#%d: ", j ); scanf( "%d", &x ); userArray(i) = x; //code pasting into forum doesn't allow [ ] if( isalpha( (char)x ) ) printf( "no alpha" ); if( x < 1 || x > 47 ) { printf( "\nThe number you are entering cannot be less than one, and no greater than forty-seven.\n\n" ); } else if( HasBeenAssigned( userArray, arraySize, x, i ) == x ) { printf( "\nPlease make sure the number you are entering has not already been assigned.\n\n" ); } else { i++; j++; } } }