On Thu, Feb 18, 2010 at 7:30 AM, Prince Annan Koomson
<[email protected]> wrote:
> --- On Tue, 2/16/10, Paul Herring <[email protected]> wrote:
> On Tue, Feb 16, 2010 at 9:44 AM, Prince Annan Koomson <pk_an...@yahoo.
> com> wrote:
>
>> The best way in swaping is using pointers
> --> No it isn't, it's to use a temporary variable.
>
>> that helps you more better than doing the normal swaping.
>
>
> --> and no it doesn't. You didn't read the article mentioned did you?
>
> Correction please using pointers from my point of view is -->the code you
> wrote and posted online e.g.swap(*x , *y){bla bla}
You still haven't read the article have you. If you had, you'd realise
why using pointers doesn't work all the time.
> there is no way you can do swapping without declaring a temporary variable
> did you listen to your self well?
There are indeed ways of doing it without using a temporary. They just
don't work all the time. As you'd have found out if you'd read the
article instead of replying without doing so.
> what i mean was doing normal swapping likeswap (int x, int y){int temp;temp =
> y;y=x;x=temp;}
> This normally does not work,But using pointers works perfectly that is what i
> mean, there is no mistake in my post sorry.
--
PJH
http://shabbleland.myminicity.com/env
http://www.chavgangs.com/register.php?referer=9375