Mail Archives: djgpp/1996/06/24/22:26:19
On 23 Jun 1996 02:49:37 GMT, nelson AT cs DOT uwp DOT edu (Jeremy Nelson) wrote:
>>From: Robert Fremin[SMTP:robert DOT fremin AT mailbox DOT swipnet DOT se]
>>
>>I had great difficulties to compile this code (example):
>>
>>void main()
>>{
>> for (int i=0; i<100; i++);
>>}
>>
>3) 'int i' is not valid in the declaration portion of a for loop.
> this is valid c++ code, but not valid c.
My prior compiler was C++, so I must have missed that rule by mistake.
(Luckily I discovered that DJGPP supported // remarks, which also(?) is
C++ by definition)
Empty parentheses should be translated to 'void' by the compiler.
>>void main()
>>{
>> int i;
>> for (i=0; i<100; i++);
>>}
>>
>>....but all the same.
>
>Odd -- it compiled for me. Could you elaborate *specifically* as to the
>error messages you got?
>
It compiled OK the next day, maybe it was some system error?
I hate it when it is some other factor but my code that make
the bugs. Sitting down debugging, when it probably only took
a reboot to solve it. I won't dig into it further.
--- Robert Fremin -----------------------------------
--- http://bip.concept.se/user/sprite/hemsida.htm ---
-----------------------------------------------------
- Raw text -