Correction of 'Yet another...'
Correction of 'Yet another...'
- Subject: Correction of 'Yet another...'
- From: Martin Kautz <email@hidden>
- Date: Thu, 06 Dec 2001 16:59:03 +0100
Hello list,
this time it's about functions (at least what I would consider as
functions).
In PHP (
http://www.php.net, that's from where I come) a function with
arguments is written as
function addvalues ($arg1, $arg2) {
return $arg1+$arg2;
}
This would be called as:
$sum=addvalues(2,3); (should be five)
What I don't understand is the syntax in Obj-C... As long as I only use one
argument it's fine. However, If I'm using more than one arguments, it looks
kinda strange to me, since I can't differ the two arguments that good.
- (int) addvalues:(int)arg1 second:(int) arg2 {
return (arg1+arg2);
}
sum=[self simpleMath:2 second:3];
Can someone explain that 'second' thing?
Why not that way:
- (int) addvalues:(int)arg1, (int) arg2 {
return (arg1+arg2);
}
sum=[self simpleMath:2,3];
Thank you!
Martin
P.S. Forgive me, if this is too stupid for this list.