Validating a tab-delimited string
Avoid nested ternary operators. It hardly ever improves readability over proper if-else conditions.

When the boolean values true and false are involved, often there's simply no need for tensors at all, like in this example:


flag = ch[i] == '\t' ? TRUE : FALSE;



This is equivalent and simpler:

flag = ch[i] == '\t';


When a condition gets complicated, another technique is to extract the complex boolean expression to a helper method with a good descriptive name.