Re: What's wrong with this code?
Re: What's wrong with this code?
- Subject: Re: What's wrong with this code?
- From: Andy Lee <email@hidden>
- Date: Thu, 25 Nov 2004 04:00:08 -0500
Your NSLog statement is wrong:
NSLog(@"Sum %f",sumOfNumbers)
You didn't put the argument list after sumOfNumbers, so this statement
doesn't call your function at all. Instead, you are passing NSLog the
address of the sumOfNumbers function, which NSLog tries to interpret as
a float.
You could have figured this out yourself by putting a breakpoint in the
sumOfNumbers() function and stepping through with the debugger. Or you
could have added NSLog statements inside the function printing the
values of count and sum. Either way, you would have seen that the
function never gets called.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden