Compare this code to your code and it will give you a hint why yours does not work.
[php]#include <iostream>
int order_chars( int*, int*, int* );
int main()
{
int c1 = 5;
int c2 = 10;
int c3 = 15;
int* c1ptr;
int* c2ptr;
int* c3ptr;
c1ptr = &c3;
c2ptr = &c2;
c3ptr = &c1;
order_chars (c3ptr, c2ptr, c1ptr);
std::cin.get(); //wait
return 0;
}
int order_chars( int* c3ptr, int* c2ptr, int* c1ptr )
{
std::cout << *c1ptr << *c2ptr << *c3ptr << std::endl;
return 0;
}
[/php]
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
Offline 5,792 posts
since Oct 2004