HELLO SHADOW!!!
HELLO SHADOW!!!
All men are created equal. But some are more equal than others.
Visit me at http://www.angelfire.com/my/billholm
i ask you straightly . can you help me?? i dont think you are eligible to help!!
"If knowledge can create problems, it is not through ignorance that we can solve them. "
-Isaac Asimov(1920-1992)
that was for shadow!
"If knowledge can create problems, it is not through ignorance that we can solve them. "
-Isaac Asimov(1920-1992)
Well...
Your algorithm for swapping seems okay, but you are not coding it properly. I think the others already presented the correct codes for you. You should try them and tell the difference between what you did and how the others did it. You can't learn if you don't analyze the problem.
All men are created equal. But some are more equal than others.
Visit me at http://www.angelfire.com/my/billholm
Okay how about this:
In order to swap the values, you should not dereference the variables.
int *a, *b, *c;
what you did was like this: c = a; you are swapping the addresses but not necessarily the values. You should have done this *c = *a; this way you will surely get what you want.
I'm not sure if I have explained this quite accurately, but I'm sure this is the main idea.
All men are created equal. But some are more equal than others.
Visit me at http://www.angelfire.com/my/billholm
> HELLO SHADOW!!!
Oh no! They let the trolls out again!
I'm outta here..
The world is waiting. I must leave you now.
> can you help me??
We have - study the first post from The Dog
If you want to output inside the swap function, try
cout << "new value of a is " << *a << endl;
>>Oh no! They let the trolls out again!
I'm outta here..<<
Oh cmon Shadow Don't go just now... You can't imagine what I have gone through...
I had to endure these past few weeks of boredom because I really missed your stupidity HWAHAHAHAHAHAHAHAHAHAHAHA!!!
Last edited by billholm; 08-04-2002 at 09:38 PM.
All men are created equal. But some are more equal than others.
Visit me at http://www.angelfire.com/my/billholm