In the old days I wrote:

int i; float f;
for( i = 0, f = 0.0; i < 5; i++, f+= 3.5 ) .....

Now I am trying to use the C99 style:
for( int i = 0, float f = 0.0; i < 5; i++, f+= 3.5 ) .....
But I am told: "parse error before 'float'".

Then I tried:
float f;
for( int i = 0, f = 0.0; i < 3; i++, f += 3.5 ) { printf("%g",f); };
But got: format '%g' expects type 'double', but argument 2 has type 'int'
and: unused variable 'f'

So: how to declare two variables of different type which are to be valid only in a for-loop?
Tiger 10.4.11; gcc version 4.0.1 (Apple Computer, Inc. build 5363)


Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to