Syntax

C++ Include a Header Syntax

In C++, include a header: includes a standard header — #include <iostream> #include <vector>

Quick Answer

Syntax
#include <iostream> #include <vector>
C++Syntax

Include a Header

Code example
#include <iostream> #include <vector>

Includes a standard header.

Learn More

How to include a header in C++

  1. Open your C++ file or editor.
  2. Copy the example, then replace its sample names and values for your code.

C++ Include a Header Syntax

Use #include <iostream> #include <vector>.

Related Syntax References

Frequently asked questions

What is the C++ syntax for include a header?

Use this pattern: #include <iostream> #include <vector>

Can I copy this C++ code example?

Yes. Use Copy code and adapt the example to your program.

Is this C++ syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify