When I read from file I want to check the word do not contains the number, for example, 2sum or 23b2 but is OK if the file read the mathematical operation like
sum = x + 5
I try to put inside the if statement [a-zA-Z]* put it does not work.
This part of my code:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
int charClass;
char lexeme [100];
void addChar();
void getChar();
void getNonBlank();
int lex();
int main() {
if ((in_fp = fopen("/Users/Desktop/ff.txt", "r")) == NULL)
printf("ERROR - cannot open front.in \n");
else {
getChar();
do {
if(strcmp(lexeme, "[a-zA-Z]*") == 0){
printf("error");
break;
}
lex();
} while (nextToken != EOF);
}
}