第四章 C++数据类型
#include
#include
using std::cout;
using std::cin;
using namespace std;
int main()
{
?//×××
?int a;
?//布爾
?bool check;
?check=0;//初始化為false
?check = true;
?//字符
?char ch;
?ch='0';
?cout<< ch <<endl;
?cout<<(int)ch<<endl;
?
?for(int i=32;i<128;i++)
?{
??cout<<(char)i;
?}
?//雙字符
?setlocale(LC_ALL,"chs");
?wchar_t wt[]=L"中文";
?wcout<<wt<<endl;
?//類型站位
?cout<<"int:"<<sizeof(int)<<endl;
?//枚舉
?enum num{aa=1,b,c,d,e,f,g};
?cout<<aa<<b<<c<<d<<e<<f<<g<<endl;
?cin>>a;
?return 0;
}
520 520小說(shuō) 520小說(shuō)網(wǎng) 小說(shuō)520 5200 小說(shuō)5200 5200小說(shuō) 5200小說(shuō)網(wǎng)
轉(zhuǎn)載于:https://blog.51cto.com/goodchenqing/1591537
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來(lái)咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的第四章 C++数据类型的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 梦到考科二挂了能考过吗
- 下一篇: 孕妇梦到家里着火了预示着什么