For the hacker edition of pset1 I'm working on credit.c. So far, I'm progressing nicely. However, I decided using a Ternary Operator assigning a value to the string variable ccType using the code below:
ccType = (firstDigits > 39) && (firstDigits < 50) ? "VISA" : (firstDigits => 51) && (firstDigits <= 55) ? "MASTERCARD" : "INVALID";
make spits out the following error:
credit.c:50:43: error: expected expression (firstDigits => 51) && ^
It looks like he doesn't like the "less than or equal to" sign inside the nested ternary operator. I guess I could rewrite it all as an if..else construction, but I'm very curious why I get this error. I've already experimented with putting braces here and there, but no result. Also, I notice the error doesn't come up in the earlier conditions, where "==" or just "<" or ">" is used. Is a Ternary operator limited to those three, and is the part "or equal to" causing the problem here? If yes, does anyone know why?