FROM : Andy Lee
DATE : Thu Nov 25 10:00:08 2004
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
DATE : Thu Nov 25 10:00:08 2004
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
| Related mails | Author | Date |
|---|---|---|
| Ayyapu Reddy | Nov 25, 09:44 | |
| Andy Lee | Nov 25, 10:00 | |
| ??? a.k.a. James C… | Nov 25, 13:54 |






Cocoa mail archive

