“С логический” Ответ

логический в c

#include <stdbool.h>
bool x = true;
Panicky Polecat

С логический

Option 1:
#include <stdbool.h>

Option 2:
typedef enum { false, true } bool;

Option 3:
typedef int bool;
enum { false, true };

Option 4:
typedef int bool;
#define true 1
#define false 0

Explanation:
Option 1 will work only if you use C99 (or newer) and its the "standard way" to do it.
Choose this if possible

Options 2,3 and 4 will have practice the same identical behavior. #2 and #3 don't use
#defines though which in my opinion is better.
Hurt Hummingbird

Ответы похожие на “С логический”

Вопросы похожие на “С логический”

Больше похожих ответов на “С логический” по C

Смотреть популярные ответы по языку

Смотреть другие языки программирования