i'm trying to have this thing reaarange the numbers in a string into descending order and then print out the new number , but something's the matter and i don't know what... help!!
Code:#include <iostream.h> #include <stdlib.h> #include <iomanip> #include <string> void ascendingdigit(int initialdigit [], int n); int main() { char initialdigit [5]; bool done = false; cout<<"Enter a non-zero 4 digit number..."<<endl; cin>>initialdigit; do { void ascendingdigit(int initialdigit [], int n); } while (!done); system("PAUSE"); return 0; } void ascendingdigit(int initialdigit[], int n) { bool exchanges; int temp; int i; do { exchanges = false; for (i=0; i<initialdigit [0] -1; i++) { if (initialdigit[i] > initialdigit[i+1]) { temp = initialdigit[i]; initialdigit[i] = initialdigit[i+1]; initialdigit[i+1] = temp; exchanges = true; cout<<temp<<endl; } } } while (exchanges); }