\n\u3000\u3000\u3000\u3000\u5728\u7f16\u5199\u7a0b\u5e8f\u65f6\uff0c\u6570\u636e\u7c7b\u578b\uff08data type\uff09\u5b9a\u4e49\u4e86\u4f7f\u7528\u5b58\u50a8\u7a7a\u95f4\u7684\uff08\u5185\u5b58\uff09\u7684\u65b9\u5f0f\u3002<\/p> \n
\u3000\u3000\u3000\u3000\u7a0b\u5e8f\u5458\u901a\u8fc7\u5b9a\u4e49\u6570\u636e\u7c7b\u578b\uff08data type\uff09\uff0c\u544a\u8bc9\u7279\u5b9a\u5b58\u50a8\u7a7a\u95f4\u8fd9\u91cc\u8981\u5b58\u50a8\u7684\u6570\u636e\u7c7b\u578b\u662f\u4ec0\u4e48\uff0c\u4ee5\u53ca\u4f60\u5373\u5c06\u64cd\u4f5c\u4ed6\u7684\u65b9\u5f0f\u3002\uff08\u6ce8\uff1a\u5b58\u50a8\u7a7a\u95f4\u6709\uff1a\u5806\u5b58\u50a8\uff0c\u6808\uff0c\u9759\u6001\u5b58\u50a8\u7b49\uff0c\u540e\u9762\u518d\u4ed4\u7ec6\u53bb\u7814\u7a76\uff09<\/p> \n <\/blockquote> \n
\u3000\u30001.\u6570\u636e\u7c7b\u578b\u53ef\u4ee5\u662f\u5185\u90e8\u7684\u6216\u8005\u62bd\u8c61\u7684\u3002<\/em><\/strong><\/h2> \n
\n
- \n
\n
- \u5185\u5efa\u6570\u636e\u7c7b\u578b\uff1a \n
\n
- \u5185\u5efa\u6570\u636e\u7c7b\u578b\u662f\u7f16\u8bd1\u5668\u53ef\u4ee5\u7406\u89e3\u7684\u6570\u636e\u7c7b\u578b\uff0c\u76f4\u63a5\u4e0e\u7f16\u8bd1\u5668\u5173\u8054\u3002C++<\/a>\u5728\u8fd9\u91cc\u51e0\u4e4e\u5b8c\u5168\u7ee7\u627f\u4e86C \u7684\u6570\u636e\u7c7b\u578b\u3002\u6216\u8005\u79f0\u4e3a\u57fa\u672c\u6570\u636e\u7c7b\u578b<\/strong><\/li> \n <\/ul> <\/li> \n
- \u62bd\u8c61\u6570\u636e\u7c7b\u578b\uff1a \n
\n
- \u53ef\u4ee5\u5148\u7406\u89e3\u4e3a\u4e00\u4e2a\u7c7b\uff08C++<\/a>\u7075\u9b42\u7684\u7cbe\u9ad3\uff0c\u6570\u636e\u7c7b\u578b\uff1a\u7c7b\uff09\uff0c\u5b83\u662f\u7531\u6211\u4eec\u81ea\u5df1\u6216\u8005\u522b\u7684\u7528\u6237\u81ea\u884c\u5b9a\u4e49\u7684\u6570\u636e\u7c7b\u578b\u3002\uff08\u8fd9\u91cc\u5b66\u4e60\u7c7b\u7684\u65f6\u5019\u5728\u4ed4\u7ec6\u5b66\u4e60\uff09\u3000\u3000<\/strong><\/em><\/li> \n <\/ul> <\/li> \n <\/ul> <\/li> \n <\/ol> \n
<\/p> \n
\n2. \u57fa\u672c\u5185\u5efa\u7c7b\u578b\uff08<\/strong><\/em>\u53c8\u79f0\uff0c\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff09<\/strong><\/em><\/h2> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u6807\u51c6C\u7684\u5185\u5efa\u7c7b\u578b\uff08\u7531C++\u7ee7\u627f\uff09\u6ca1\u6709\u8bf4\u660e\u5fc5\u987b\u591a\u5c11\u4f4d\u3002\u53ea\u662f\u89c4\u5b9a\u4e86\u5185\u90e8\u6570\u636e\u7c7b\u578b\u5fc5\u987b\u80fd\u5b58\u50a8\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c\u3002<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000C++\u548cC\u5185\u90e8\u6570\u636e\u7c7b\u578b\u67094\u4e2a\u57fa\u672c\u7c7b\u578b\u3002\u5206\u522b\u662f\uff1achar\uff0cint, float & double \u3002\uff08\u5982\u4e0b\u4ecb\u7ecd\uff1a<\/p> \n
\u3000\u3000\u3000\u3000<\/p> \n
<\/p> \n
<\/h2> \n
\n\u30002.1 \u8bf4\u660e\u7b26\uff08specifier\uff09<\/h2> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u8bf4\u660e\u7b26\uff08specifier\uff09\u7528\u4e8e\u6539\u53d8\u57fa\u672c\u5185\u5efa\u7c7b\u578b\u7684\u542b\u4e49\uff0c\u5e76\u628a\u5b83\u4eec\u6269\u5c55\u4e3a\u4e00\u4e2a\u66f4\u5927\u7684\u96c6\u5408\uff0c\u6709\u4ee5\u4e0b\u56db\u79cd\uff1a<\/p> \n
\n
- \n
\n
- \n
\n
- signed<\/li> \n
- unsigned<\/li> \n
- short<\/li> \n
- long\u3000<\/li> \n <\/ul> <\/li> \n <\/ul> <\/li> \n <\/ul> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u6ce8\uff1asigned (\u4ee3\u8868\u6709\u7b26\u53f7)\u548c unsigned\uff08\u4ee3\u8868\u65e0\u7b26\u53f7\uff09\u3002\u56e0\u4e3a\u6570\u636e\u7c7b\u578b\u5728\u8ba1\u7b97\u673a\u4e2d\u4ee5\u4e8c\u8fdb\u5236\u5b58\u50a8\uff0c\u6709\u7b26\u53f7\u7684\u5c31\u4f1a\u5360\u53bb\u4e00\u4e2a\u6bd4\u7279\u4f4d\u6765\u8868\u793a\u7b26\u53f7\u4f4d\u3002\u76f8\u5e94\u7684\u53d6\u503c\u8303\u56f4\u4e5f\u4f1a\u53d8\u5c0f\u3002<\/p> \n
\n
\u3000\u3000\u4e00\u822c\u4e0a\u9762\u7684\u56db\u79cd\u57fa\u672c\u7c7b\u578b\u53ef\u4ee5\u518d\u4f7f\u7528\u4e00\u4e2a\u6216\u591a\u4e2a\u8bf4\u660e\u7b26\u8fdb\u884c\u4fee\u9970\u3002\u8be6\u7ec6\u7684\u53c2\u8003\u5982\u4e0b\u56fe\u793a\uff1a<\/strong><\/h4> <\/li> \n <\/ul> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\uff08\u53e6\u5916\uff0c\u5728\u9762\u8bd5\u7684\u65f6\u5019\u9762\u8bd5\u5b98\uff0c\u5982\u679c\u95ee\u5230\uff0c\u4f8b\u5982char\u4e00\u5b9a\u662f1\u4e2a\u5b57\u8282\u5417\uff1f\u4e00\u822c\u4f1a\u56de\u5230\u89c6\u673a\u5668\u800c\u5b9a\uff0c\u4e00\u822c\u662f\u4e00\u4e2a\u5b57\u8282\uff09<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000<\/p> \n
<\/p> \n
<\/p> \n
\n\u30002.2 bool\u7c7b\u578b<\/strong><\/em><\/h2> \n
\u3000\u3000\u3000\u3000\u3000\u3000<\/em>\u5728bool\u7c7b\u578b\u6210\u4e3aC++\u6807\u51c6\u4e4b\u524d\uff0c\u6bcf\u4e2a\u4eba\u90fd\u5728\u7528\u81ea\u5df1\u7684\u65b9\u6cd5\u5b9e\u73b0\u7c7b\u4f3c\u4e8ebool\u7c7b\u578b\u7684\u884c\u4e3a\u3002\u8fd9\u79cd\u65b9\u5f0f\u662f\u5f88\u4e0d\u5229\u4e8e\u53ef\u79fb\u690d\u6027\u7684\u3002<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u8c08\u5230bool\uff0c\u5fc5\u987b\u8981\u8c08\u5230\u4e24\u4e2a\u5185\u5efa\u5e38\u91cf<\/strong>\uff1atrue\uff08\u8f6c\u6362\u4e3a\u6574\u65701\uff09 & false\uff08\u8f6c\u6362\u4e3a\u6574\u65700\uff09\u3002\uff08\u6ce8\uff1a\u5185\u5efa\u5e38\u91cf\u6682\u4e0d\u89e3\u91ca\uff09<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u6b64\u5916\u4e00\u4e9b\u8bed\u8a00\u5143\u7d20\u4e5f\u88ab\u91c7\u7eb3\uff0c\u5728C++ \u4e2d\uff1a<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000<\/p> \n
\u3000\u3000\u3000\u3000\u56e0\u4e3a\u73b0\u5728\u5f88\u591a\u4ee3\u7801\u4f7f\u7528\u7684\u662f\u6574\u578bint\u8868\u793a\u4e00\u4e2a\u6807\u5fd7\uff0c\u6240\u4ee5\u7f16\u8bd1\u5668\u9690\u5f0f\u8f6c\u6362int\u4e3abool\uff08\u975e\u96f6\u503c\u4e3atrue\uff0c\u96f6\u503c\u4e3afalse\uff09<\/p> \n
<\/p> \n
\n\u3000\u30002.3 \u679a\u4e3e\u7c7b\u578b<\/em><\/h2> \n
\u3000\u3000\u3000\u3000\u679a\u4e3e\uff08enumerated\uff09\u7c7b\u578b\u5c31\u662f\u6307\u4ed6\u7684\u503c\u4e3a\u7b26\u53f7\u5e38\u91cf\u800c\u4e0d\u662f\u5b57\u9762\u503c\u7684\u7c7b\u578b\uff0c\u5979\u4eec\u901a\u5e38\u4ee5\u4e0b\u9762\u5f62\u5f0f\u58f0\u660e\uff1a<\/em>\u3000\u3000\u3000\u3000<\/em><\/p> \n
\nenum<\/span> Type{ CUP, PINT, QUART, HALF, GALLON };<\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u8fd9\u6761\u8bed\u53e5\u58f0\u660e\u4e86\u4e00\u4e2a\u7c7b\u578b\uff0c\u79f0\u4e3aweek\u3002\u8fd9\u79cd\u7c7b\u578b\u7684\u53d8\u91cf\u6309\u4e0b\u9762\u65b9\u5f0f\u58f0\u660e\uff1a<\/p> \n
\nenum<\/span> Type CUP, PINT, QUART, HALF, GALLON ;<\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u8fd9\u79cd\u53d8\u91cf\u7684\u5b58\u50a8\u65b9\u5f0f\u5b9e\u9645\u65b9\u5f0f\u662f\u6574\u578b\u7684\u5f62\u5f0f\uff0c\u7b2c\u4e00\u4e2a\u53d8\u91cf\u662f0\uff0c\u7b2c\u4e8c\u4e2a\u662f1\uff0c\u4ee5\u6b64\u5f80\u540e\uff08\u5728\u4e0d\u8d4b\u503c\u7684\u60c5\u51b5\u4e0b\uff09\u3002\u5f53\u7136\u5728\u9002\u5f53\u7684\u662f\u540e\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u8d4b\u503c\u7279\u5b9a\u7684\u6574\u578b\u503c\u3002<\/p> \n
\nenum<\/span> Type{ CUP=1<\/span>, PINT=5<\/span>, QUART=3<\/span>, HALF=11<\/span>, GALLON };<\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u5982\u4e0a\u9762\uff0c\u5e76\u6ca1\u6709\u5bf9\u6700\u540e\u4e00\u4e2a\u53d8\u91cf\u8d4b\u503c\uff0c\u90a3\u4e48\u4ed6\u7684\u503c\u5c31\u6bd4\u524d\u9762\u4e00\u4e2a\u59271\uff0c\u4e3a12\uff1b\u3000\u3000\u3000\u3000<\/p> \n
\u3000\u3000<\/h2> \n
\n\u3000\u30002.4 typedef<\/h2> \n
\u3000\u3000\u3000\u3000C\u8bed\u8a00<\/a>\u652f\u6301\u4e00\u79cd\u53eb\u505atypedef\u7684\u673a\u5236\uff08\u5f53\u7136C++\u4e5f\u662f\u540c\u6837\u652f\u6301\u7684\u5566\uff0c\u6bd5\u7adf\u662f\u7ee7\u627f\u4e86C\u7684\u4f18\u826f\u54c1\u6027\uff09\u3002\u4ed6\u5141\u8bb8\u4f60\u4e3a\u5404\u79cd\u6570\u636e\u7c7b\u578b\u5b9a\u4e49\u65b0\u7684\u540d\u5b57\u3002typedef\u58f0\u660e\u7684\u5199\u6cd5\u548c\u666e\u901a\u7684\u58f0\u660e\u57fa\u672c\u76f8\u540c\uff0c\u53ea\u662f\u5427typedef\u8fd9\u4e2a\u5173\u952e\u5b57\u51fa\u73b0\u5728\u58f0\u660e\u7684\u524d\u9762\u3002\u4f8b\u5982\u4e0b\u9762\u7684\u8fd9\u4e2a\u58f0\u660e\uff1a<\/p> \n
<\/p> \n
\nchar<\/span> *ptr_char;<\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u628a\u53d8\u91cfptr_char\u58f0\u660e\u80fd\u591f\u4e3a\u4e00\u4e2a\u6307\u5411\u5b57\u7b26\u7684\u6307\u9488\uff0c\u4f46\u662f\u5728\u4f60\u6dfb\u52a0\u5173\u952e\u5b57typedef\u540e\uff0c\u58f0\u660e\u53d8\u4e3a\uff1a<\/p> \n
\ntypedef char<\/span> *ptr_char;<\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u8fd9\u79cd\u58f0\u660e\u5427prr_char\u4f5c\u4e3a\u53ea\u60f3\u5b57\u7b26\u7684\u6307\u9488\u7c7b\u578b\u7684\u65b0\u540d\u5b57\uff08\u8fd9\u91cc\u5bf9\u6307\u9488\u53ef\u4ee5\u4e0d\u4e86\u89e3\uff0c\u6bd5\u7adf\u8fd8\u5230\u540e\u9762\u624d\u5b66\u7684\u5230\uff09\u3002\u4f60\u53ef\u4ee5\u50cf\u4f7f\u7528\u4efb\u4f55\u4e2a\u9884\u5b9a\u4e49\u540d\u5b57\u4e00\u6837\uff0c\u5728\u4e0b\u9762\u7533\u660e\u4e2d\u4f7f\u7528\u65b0\u540d\u5b57\u3002\u5982\u4e0b\uff1a<\/p> \n
<\/p> \n
\nptr_char a;<\/pre> \n <\/div> \n\u3000\u3000\u3000\u3000\u58f0\u660e\u4e86a\u6307\u5411\u5b57\u7b26\u7684\u6307\u9488\u3002<\/p> \n
\u3000\u3000\u3000\u3000\u6ce8\uff1atypedef\u4e0e#define\u8fd8\u662f\u6709\u533a\u522b\u7684\uff0c\u9762\u8bd5\u7684\u65f6\u5019\u53ef\u80fd\u4f1a\u88ab\u95ee\u5230\u3002\u867d\u7136\u90fd\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u65b0\u7684\u7c7b\u578b\u540d\u3002\u4f46\u662f\u540e\u8005\u65e0\u6cd5\u6b63\u786e\u7684\u5904\u7406\u6307\u9488\u7c7b\u578b\u3002\u5982\u4e0b\uff1a<\/p> \n
\n#define<\/span> ptr_char char *\r\n ptr_char a,b;<\/span><\/pre> \n <\/div> \n
\u3000\u3000\u3000\u3000\u53ef\u4ee5\u6b63\u786e\u7684\u4f7f\u7528a\uff0c\u4f46\u662fb\u5374\u88ab\u58f0\u660e\u4e00\u4e2a\u5b57\u7b26\u3002\u6240\u4ee5\u901a\u5e38\u5b9a\u4e49\u590d\u6742\u7684\u7c7b\u578b\u65f6\uff0c\u9009\u62e9typedef\u66f4\u4e3a\u7a33\u59a5\u3002<\/p> \n
<\/p> \n
\n<\/p> \n
<\/p> \n
<\/p> \n
<\/p> \n
\u3000\u3000\u3000\u3000\u3000\u3000<\/p> \n
\u3000\u3000\u3000<\/p>\n<\/div>","orderid":"0","title":"C++\u6570\u636e\u7c7b\u578b\uff08data type\uff09\u4ecb\u7ecd","smalltitle":"","mid":"0","fname":"c++\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"67","pages":"1","comments":"0","posttime":"2019-07-14 14:09:41","list":"1563084581","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u6570\u636e<\/A> \u7c7b\u578b<\/A> data<\/A> type<\/A> \u4ecb\u7ecd<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"47.106.78.186","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"C++\u6570\u636e\u7c7b\u578b\uff08data type\uff09\u4ecb\u7ecd","lastview":"1713505567","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}