### permutation function call help.

Doing an exercise that states...

A permutation of three objects, a, b, and c, is any arrangement of these objects in a row. For example, some of the permutations of these objects are abc, bca, and cab. The number of permutations of three objects is six. Suppose that these three objects are strings. Write a program that prompts the user to enter three strings. The program then outputs the six permu- tations of those strings

http://forum.codecall.net/topic/64715-how-to-generate-all-permutations/
, but having trouble integrating..
any feedback help would be really appreciated.

 ``12345678910111213141516171819202122`` ``````#include using namespace std; int main(int argc, const char * argv[]) { string objects[3]; for (int i = 0, k = 1; i < 3; i++, k++) { cout << "Please enter a string: " << endl; cin >> objects[i]; if (k == 3) { cout << "We made it here: debug print" << endl; for (i = 0; i < 3; i ++) { // enter permutation function call here... } } } return 0; } ``````

 ``123456789101112131415161718192021222324252627282930`` ``````#include using namespace std; void permut(string s); int main(int argc, const char * argv[]) { string objects[3]; for (int i = 0, k = 1; i < 3; i++, k++) { cout << "Please enter a string: " << endl; cin >> objects[i]; if (k == 3) { cout << "We made it" << endl; for (i = 0; i < 3; i ++) { permut(objects[i]); } } } return 0; } void permut(string s){ do{ cout<
Last edited on
Topic archived. No new replies allowed.