Hello.
I need help with sorting strings that i read from a file, the file contains strings like ("int" , "[" , "]", "x", "1")
i put them into array and now i need to sort them to 3 category arrays :
integers: "1" "2" ... "9"
IDs : "x" "read" "write" ......
keywords: "int" "fact" "void" " "while" " "return" .....
can someone show me some code that can sort the array.
thank you !
Content of File :
"void main ( void )
{ int x ;
x = read ( ) ;
if ( x > 0 ) write ( fact ( x ) ) ;
} "
i need to sort them like :
KeyWord[] = void;
Keyword[] = main;
ID[] = x;
Integer[] = 0;
and so on. but i dont know how to make the program know which is int and which is ID