J
jacob navia
Barry said:That one is simple enoughRuud said:Hallo allemaal,
During the conversion of my program from Pascal to C, I was more or
less able to find the C equivalent of most Pascal functions so far.
Only four gave me some real trouble. I solved them but it could be I
overlooked something.
1) In Pascal you can declare functions inside a function. AFAIK this
is not possible with C. Or am I wrong?
2) In Pascal there exists the "in" function. Example:
if (c in ['A'..'F', '0'..'9']) then { c is hexadecimal }
This can be translated like:
if ( ((c >= 'A') && (c <= 'Z'))
|| ((c >= '0') && (c <= '9'))) .... // c is hexadecimal
I just wonder if there is a more simpler solution.
Except for the fact that it doesn't work on an EBCDIC system.
yes. A better solution is ishexdigit()...