What is necessary to include?

I want to make simple programs with C++ (mainly input/output based programs) what do I need to include? Is iostream enough, or do I have to include something else?
It depends what you want to do. You probably need strings, maybe some output formatting (iomanip) . If you want to store your input somewhere you might need vector as well.
If you want to store your output in a file then you need fstreams.
Is there anything you would recommend for a beginner program?
a typical first program or so just has <iostream> and <string>.
after a short while you will realize which ones you need for what things or at least where to look online if you need something and forgot what header it was in.
For a truly basic beginner's program, the famous "Hello World" example, the only header needed is <iostream>.

What you need to include depends on what features of the C++ Library you use. As someone learns more C++ features more headers will be required.

A list of C++ Standard Library headers:
https://en.cppreference.com/w/cpp/header

Some header files include other header files. What is also-included can vary from implementation to implementation. MSVC vs. GCC, for example.
Thanks a lot for the help!
Topic archived. No new replies allowed.