This is probably very simple to some but I have been working on it for a while and im stuck. Im reading data from a text file and one column is all Y and N, Y being true, and N being false. I need to convert the Y and N values in the array to 1 and 0 in Boolean. Anyone know how I could go about doing this? Ive been trying simple things like
// need to have variables:
char c;
bool b;
c = get_char_from_file_somehow();
// you can do this...
if(c == 'Y')
b = true;
else
b = false;
// or you can shortcut it with this:
b = (c == 'Y');