C Programming – Boolean type

In other programming languages, such as Pascal and Fortran, boolean data type is “built-in" with the language. For example, for Pascal, it’s declared as “boolean".

For C language, this data type is included in the, which is a standard library (C99 Standard).

1. Include the stdbool.h: #include <stdbool.h>

2. To declare boolean data type: bool boolean_sample;

3. To set values for boolean_sample: boolean_sample = true || boolean_sample = false (Where true and false MUST BE IN LOWER-CASE)

對「C Programming – Boolean type」的想法



WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )


您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s