I am trying to use isaplha() function in order to check every character of each string to be sure if it is alphabetic. But for some reason it does not work. Program always goes into printf() function despite of an argument of an if statement. It seems that everything is okay with the code:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define N 5
int main(void)
{
char string[N][50];
int i,j;
printf("Enter an array of N strings:\n");
for(i=0;i<N;i++){
gets(string[i]);
}
for(i=0;i<N;i++){
for(j=0;j<50;j++){
if(isalpha(string[i][j])){
printf("\nIt should not work with numbers");
}
}
}
return 0;
}