i am writting a program for finding the no of keyword ( occurances ) and operators occurances.
i am taking the all the keywords in an array and all the operators in seperate arrays for each category of operators.
char *kw[] = {"auto","break"..."while" };
char *Arth_op[] = { "%","*","+","-","/"};
according to the ascii value of that characters.
and using the binary search and other support functions i am finding the occurances of all the keywords and opearators.
now the problem is, there are operators with two characters
like :
>= , <=, ++, --, ==, += -= and many
here i cannot use my bsearch function.
to find the occurance of an operators
all the keywords and operators are arranged in the array in increasing ascii value of characters for single charcater operators.
but how to handle the assignment and relational operators.
please suggest me a way to solve this problem.
or suggest me is there any other method to solve the problem.