C + + Programming Fundamentals 106-Boolean type

Source: Internet
Author: User

1 //06-Boolean type. cpp: The entry point that defines the console application. 2 //3 4#include"stdafx.h"5#include <iostream>6 using namespacestd;7 8 intMain ()9 {Ten     BOOLA =true;//true existence of non 1 One     BOOLb =false;//false does not exist 0 Acout << a << Endl;//The direct Output boolean value is 1 . -  -A = -; thecout << a << Endl;//Although it is 100, the output is 1 because the non-0 output value is 1 -cout << b << Endl;//The output result is 0.  -  -     //0 1 2.....true false ' a ' these values are constants, and you can add a const before the variable to define the variable as a constant.  +     Const intj = -;//If you need a value that never changes, you can set the constant to prevent it from being modified.  -     inti = -; +i = -; Acout << J <<Endl; at  -     intT; -CIN >>T; -     return 0; -}

C + + Programming Fundamentals 106-Boolean type

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.