B
BartC
jean francois said:I see . . . so in effect, if() is really a special kind of fonction ?
No. It's just a coincidence that it looks like function syntax. C just likes
lots of brackets and parentheses around things.
C:
if (expression) statement; [else statement;]
Pascal:
if conditional-expression then statement; [else statement;]
Block statements in C:
{statement; ...;}
Pascal:
begin statement; ... end
(with slightly different rules about semicolons as you will no doubt come
across.)
But if you're translating C to Pascal, as I think you said somewhere, then
you don't have to write this stuff, just figure out what it does, which is
easier.)
You need to worry more about C features that might not translate so simply;
dynamic arrays for example. (Last time I used Pascal, arrays were a fixed
size.)