Save yourself the headaches and make some conversion functions to repesent cards as integers. Example:



int ch2rank(char chrank) {
switch(toupper(chrank)) {
case 'A': return 1;
...