Say I have a char array
, I wanna classify its element into three states. If it's a number, then mark it as State 1
, if it's a operator, then mark it as State 2
, if else, mark it State 3
.
First, I initialize a boolean array
to represent its state, but I fount it only can store two states:(
Then I switch to int array
, yet this way is kinda a waste of space.
Could you offer better idea please?