C++ 關鍵字: break
來自 cppreference.com
[編輯] 用法
-
break
語句:作為語句的宣告
[編輯] 示例
執行此程式碼
#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 起) |