![]() |
| ||
| String Sorting Help #include <iostream> 1) i am trying to get user to input a list of words and then i need to: * sort them in alpha orders * and display how many time each word is present in the string. ignore case. for ex: bob == BOB 2) my current code can takes a string input and convert all the words in the string into upper case and tokenized them into parts. 3) i need help on how to compare each of the tokenized words and see if they are equal. 4) samples of ideal inputs and outputs i need my code to do input bill bill joe jack dan bob BILL BOB output BILL BOB DAN JACK JOE BILL 3 BOB 2 DAN 1 JACK 1 JOE 1 THANKS |
| ||
| Re: String Sorting Help Here is the standard way to convert a string to upper case while (*c) After tokenizing the string you need to put them in an array so that you can search the array for a string. |
| ||
| Re: String Sorting Help TO A.D. How do i compare the strings to check if any words are the same? also how should put the tokenized string into a array, a loop? |
| ||
| Re: String Sorting Help >>How do i compare the strings to check if any words are the same? strcmp() >>also how should put the tokenized string into a array, a loop? char *array[255] = {0}; // room for 255 strings |
| ||
| Re: String Sorting Help To A.D.: One more question. How do i use qsort to sort the tokenized string into alpha order?? thanks. |
| ||
| Re: String Sorting Help qsort. See the example in that post. |
| All times are GMT -4. The time now is 2:29 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC