I tried using both switch and while loop to check but it only works for the first condition. For example, if it's the second condition "else if (sc == xValue || so == dsc)", my vector sort will not work.
I have tested individual sorting for vectors, they works just fine but not when using in this switch case or even while loop.
You need to take a second look at that construct. As long as "sc == xValue" then the "else" clause will never be executed. Perhaps you intended to use "&&" instead of "||"? I can't tell without seeing the rest of the code.
Also, the caffeine is wearing off, so I'm sorry if I just typed a whole load of nonsense up there...