November 22nd, 2012, 08:45 PM
Best Variable to Use
Hello. I have a question that is more of a general programming question.
I am making a class and I ran into a data member that I am having trouble deciding what variable type to use.
I have a data that can only be one of two values. They are strings, say "black" and "White".
I was thinking of just using the string type, but then I thought it might be better to use a bool since the value can take only one of two values.
The data will be used to do so decision making as well as be displayed on the screen, possibly.
What would be the optimum data type to use in this situation, because I can see the use of several?
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.