View Single Post
  #11  
Old April 20th, 2005, 04:16 PM
AngleWyrm's Avatar

AngleWyrm AngleWyrm is offline
Second Lieutenant
 
Join Date: Mar 2005
Location: Seattle, WA
Posts: 417
Thanks: 0
Thanked 0 Times in 0 Posts
AngleWyrm is on a distinguished road
Default Re: OT: Look what I can do...

Suggestion for version 2:
Separate input, output and processing into their own functions. It's real good exercise. Something like

main(){
get_input( variables )
process_input( variables )
put_output(screen)
put_output(file)
}

My brother never learned to use functions, and now he codes his entire programs all in main().
So now he can't write big programs, because after a while it becomes too much to follow in one function.
Try reading a 500-line function! One page is plenty.
Reply With Quote