//程序作者:管寧
//站點:www.cndev-lab.com
//所有稿件均有版權,如要轉載,請務必聞名出處和作者
#include <iostream>
using namespace std;
void main(void)
{
但是一些概念不清的人卻不知道布爾類型的對象也可以被看做是一種整數類型的對象,但是他不能被聲明成signed,unsigned,short long,假如你生命成(short bool found=false;),那么將會導致編譯錯誤。 #include <iostream>
#include <string>
using namespace std;
void main(void)
{
bool found = true;
int a = 1;
cout << a + found << endl;
cin.get();
}
#include <iostream>
using namespace std;
void main(void)
{
int a = 1;
int *pi;
pi=&a;
if (*pi)
{
cout << "*pi為真" << endl;
}
cin.get();
}
新聞熱點
疑難解答