![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
Join Date: Mar 2005
Posts: 148
Rep Power: 4
![]() |
How would I implement the array idea?
|
|
|
|
|
|
#12 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Don't make max the word with the longest length, since you may have more than one word of that length. Make max the SIZE of the word(s) with the longest length. Then go through your array of words and output each one that has max size. Falling off a log.
Your code is that of a novice or a schlock. I can easily break it from the keyboard. Learn to test your input functions for failure. Now that you know to do that, continuing to fail to do so will tell us which you are.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|