I am fairly new to c++ and I just wanted to know when to use functions and what's the point of using them. Can't you just put everything in "main()". How would I know when to use them and why would I need to use them? Thanks in response!
- When you want to do the same thing multiple times, perhaps with different parameters.
- To create reusable code. You want to create functions for code that you want to use more than once.
- To create small and easily testable blocks of code that do one thing.