Tuesday, July 28, 2009

Question with c++?

hi all,





can any body give me small programme in c++ that store, sort and print list of name using array ...using function ReadList,,SortList,,,PrintList





note:


use referense and pointer argument and parameter

Question with c++?
// here's a start


// all you need to do is implement the three functions :)





#include %26lt;iostream%26gt;


#include %26lt;string%26gt;


using namespace std;





void readList(string []);


void sortList(string []);


void printList(string []);





int main(){


  int numEntries;


  cout %26lt;%26lt; "Please enter number of names to read: ";


  cin %26gt;%26gt; numEntries;


  string * theList = new string [numEntries];


  readList(theList);


  sortList(theList);


  printList(theList);


  return EXIT_SUCCESS;


}





void readList(string [] s){


  // your code goes here


}





void sortList(string [] s){


  // your code goes here


}





void printList(string [] s){


  // your code goes here


}


No comments:

Post a Comment