• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Correction of 'Yet another...'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Correction of 'Yet another...'
      • From: Enigmarelle Development <email@hidden>
    • Re: Correction of 'Yet another...'
      • From: Donald Brown <email@hidden>
  • Prev by Date: Re: Finder Show Info Comments
  • Next by Date: Re: Finder Show Info Comments
  • Previous by thread: Re: Yet another stupid question...
  • Next by thread: Re: Correction of 'Yet another...'
  • Index(es):
    • Date
    • Thread