if (hex = 'A') = is assignment but you want comparison so you should use ==. 'A' is not a string, so you can't compare it with a string. You need to make it a string (or make hex a char but I don't think that is what you want).
In the end it becomes something like this: if (hex == "A")
hex = 1111; This compiles but that is just because std::string has an operator= that takes a char as argument so it is equivalent to hex = 'W'; (well, at least for me it is). What I think you mean is hex = "1111";