View Single Post
Old Jun 12th, 2005, 12:45 PM   #3
kirkl_uk
Programmer
 
kirkl_uk's Avatar
 
Join Date: Apr 2005
Location: England
Posts: 86
Rep Power: 4 kirkl_uk is on a distinguished road
Send a message via MSN to kirkl_uk
Just for two integers, another option would be to provide references to the two:

bool funct(int& x, int& y) {
  ...
}

Then you call the function like so:

int x, y;

if(funct(x, y)) {
  printf("The two values returned: %d and %d", x, y);
}

This allows for you to return whether the function succeeded as well. Both methods put forward in this thread will work.
__________________
kirkl_uk
kirkl_uk is offline   Reply With Quote