在c中设置布尔值

2022-05-07

以下示例是关于C中包含在c中设置布尔值用法的示例代码,想了解在c中设置布尔值的具体用法?在c中设置布尔值怎么用?在c中设置布尔值使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:set value of boolean in c源码类型:C
#include <stdbool.h> // Header-file for boolean data-type.
int main() {  
    bool x=false;  // Declaration and initialization of boolean variable.
    if (x==true) {  // Conditional statement.    
        printf("The value of x is true");  
    } else {  
        printf("The value of x is false");  
    }
    
    return 0;  
    // Output: The value of x is false
}

本文地址:https://www.itbaoku.cn/snippets/785177.html