I have been thinking about open and closed source and which is best for making a program. I know that this depends on what sort of program it is, so if I was doing homework from my C++ tutor, then I would make it open source so the code could easily analysed. But if I was to make a free program that I would share with other people so they could use it as a practical tool, would it be a good idea to make it open source? And can someone please outline what is and isn't good about open and closed source?
C++ is write-once-compile-anywhere. By distributing a pre-compiled binary (assuming that's what you mean by closed-source), you would limit the distribution to those who have the same platform and OS and installed shared libraries as your build system.
Also, unless someone has reasons to trust their computer security to you, they won't run your binary anyway, since there is no way to prove that it contains no malicious code.
If you want to give your software away for free, make it open source. I never understood the point of having closed-source freeware, and I always get bummed out whenever I want to add a feature to a program that I use and only find out that it's free-as-in-beer.
If you are starting a company, for example, and you plan on selling your software and making a business out of software licensing then closed-source is probably the route you should go. There are always exceptions, like Red Hat, that make good business out of selling open-source software too.
so if I was doing homework from my C++ tutor
You are at a point right now where you don't even really need to consider licensing at all. You don't need to license anything just to hand in an assignment; you are overthinking.