名稱空間
變體
操作

C++ 關鍵字: break

來自 cppreference.com
< cpp‎ | 關鍵字
 
 
C++ 語言
 
 

[編輯] 用法

[編輯] 示例

#include <iostream>
 
int main() noexcept
{
    for (int i{0}; i < 69; ++i)
    {
        if (i == 3) [[unlikely]]
            break; // breaks from the 'for' loop
        std::cout << i;
    }
}

輸出

012

[編輯] 參見

(C++17 起)
(C++23 起)
(C++20 起)