C语言--使用技巧(一)基础类型使用篇

一、布尔型的使用

使用方法:

  • typedef int bool;
  • typedef char bool;
  • typedef enum {false, true} bool;
#include <stdio.h>

typedef enum {false, true} bool;

bool returnTest()
{
    return true;
}

int main(void) {

    printf(">>>>%d\r\n", returnTest());

    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_28877125/article/details/80361280
今日推荐