|Physics and Astronomy|
Back to top
On this page
Simple text exercises
Remember that a "writeable string" is just an array of characters and that at this stage we assume that anything read from the keyboard such names etc. do not have spaces. You may assume that all names are 10 characters or less.
Split the above into two parts: read in the names inside main() then pass (the address of) the two-dimensional array to a function to do the second part.
Now write a second function that also gets passed (the address of) the two-dimensional array. Have this function ask for a minimum length and print out all the names this long or longer.
Now write a third function that also gets passed (the address of) the two-dimensional array. Have this function print out every name that is alphabetically before the first one. You should use strcmp().