Skip to content

Basic

C/C++ basic

Include path

  1. #include <header>: Angle Brackets

  2. This form is typically used for including standard library headers or headers provided by the compiler. The compiler searches for the header file in the standard system directories.

#include <iostream>

#include <vector>
  1. #include "header": Double Quotes

  2. This form is used for including user-defined headers or headers that are part of the project. The compiler searches for the header file first in the current directory and then in the standard system directories if not found.

#include "myheader.h"

#include "utils/functions.h"

Example:

Let’s say you have a user-defined header file named myheader.h and a standard library header file named iostream. You can include them as follows:

// Including a user-defined header with double quotes

#include "myheader.h"

// Including a standard library header with angle brackets

#include <iostream>

enum

usage

enum fruit {
    apple,
    banana,
    lemon,
    mango,
    orange
}

image-20250106193248678

image-20250106193312216