{"id":2573,"date":"2020-03-21T18:27:53","date_gmt":"2020-03-21T18:27:53","guid":{"rendered":"https:\/\/itteacheritfreelance.hk\/wordpress\/?p=2573"},"modified":"2020-03-21T18:45:24","modified_gmt":"2020-03-21T18:45:24","slug":"c-type","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2020\/03\/21\/c-type\/","title":{"rendered":"C++ \u4fee\u9970\u7b26\u7c7b\u578b"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/04\/c-c-programming-for-hackers-part-1-introduction.1280x600.jpg\" alt=\"C++ ,C\u8bed\u8a00, \u96fb\u8166\u73ed, C\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00, C\/C++\u96fb\u8166\u73ed, \u96fb\u8166\u8ab2\u7a0b, \u96fb\u8166\u8ab2\u7a0b, C++\u88dc\u7fd2\u6559\u5b78, C++\u88dc\u7fd2,C++\u7a0b\u5f0f\u7de8\u5beb,C++\u8ab2\u7a0b\u88dc\u7fd2,C++, \u5927\u5b78\u751fC++\u8ab2\u7a0b ,C++1 \u5c0d 1 \u79c1\u4eba\u96fb\u8166\u8ab2\u7a0b, C++1 \u5c0d 1 \u79c1\u4eba\u96fb\u8166\u88dc\u7fd2,C++\u79c1\u4eba\u88dc\u7fd2, C++\u96fb\u8166\u8208\u8da3\u73ed, C++\u96fb\u8166\u88dc\u7fd2\u73ed\" class=\"wp-image-175\"\/><figcaption>C\/C++<\/figcaption><\/figure>\n\n\n\n<p>C++ \u5141\u8bb8\u5728&nbsp;<strong>char\u3001int \u548c double<\/strong>&nbsp;\u6570\u636e\u7c7b\u578b\u524d\u653e\u7f6e\u4fee\u9970\u7b26\u3002\u4fee\u9970\u7b26\u7528\u4e8e\u6539\u53d8\u57fa\u672c\u7c7b\u578b\u7684\u542b\u4e49\uff0c\u6240\u4ee5\u5b83\u66f4\u80fd\u6ee1\u8db3\u5404\u79cd\u60c5\u5883\u7684\u9700\u6c42\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u5217\u51fa\u4e86\u6570\u636e\u7c7b\u578b\u4fee\u9970\u7b26\uff1a<\/p>\n\n\n\n<ul><li>signed<\/li><li>unsigned<\/li><li>long<\/li><li>short<\/li><\/ul>\n\n\n\n<p>\u4fee\u9970\u7b26&nbsp;<strong>signed\u3001unsigned\u3001long \u548c short<\/strong>&nbsp;\u53ef\u5e94\u7528\u4e8e\u6574\u578b\uff0c<strong>signed<\/strong>&nbsp;\u548c&nbsp;<strong>unsigned<\/strong>&nbsp;\u53ef\u5e94\u7528\u4e8e\u5b57\u7b26\u578b\uff0c<strong>long<\/strong>&nbsp;\u53ef\u5e94\u7528\u4e8e\u53cc\u7cbe\u5ea6\u578b\u3002<\/p>\n\n\n\n<p>\u4fee\u9970\u7b26&nbsp;<strong>signed<\/strong>&nbsp;\u548c&nbsp;<strong>unsigned<\/strong>&nbsp;\u4e5f\u53ef\u4ee5\u4f5c\u4e3a&nbsp;<strong>long<\/strong>&nbsp;\u6216&nbsp;<strong>short<\/strong>&nbsp;\u4fee\u9970\u7b26\u7684\u524d\u7f00\u3002\u4f8b\u5982\uff1a<strong>unsigned long int<\/strong>\u3002<\/p>\n\n\n\n<p>C++ \u5141\u8bb8\u4f7f\u7528\u901f\u8bb0\u7b26\u53f7\u6765\u58f0\u660e<strong>\u65e0\u7b26\u53f7\u77ed\u6574\u6570<\/strong>\u6216<strong>\u65e0\u7b26\u53f7\u957f\u6574\u6570<\/strong>\u3002\u60a8\u53ef\u4ee5\u4e0d\u5199 int\uff0c\u53ea\u5199\u5355\u8bcd&nbsp;<strong>unsigned\u3001short<\/strong>&nbsp;\u6216&nbsp;<strong>unsigned\u3001long<\/strong>\uff0cint \u662f\u9690\u542b\u7684\u3002\u4f8b\u5982\uff0c\u4e0b\u9762\u7684\u4e24\u4e2a\u8bed\u53e5\u90fd\u58f0\u660e\u4e86\u65e0\u7b26\u53f7\u6574\u578b\u53d8\u91cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">unsigned x;\nunsigned int y;<\/pre>\n\n\n\n<p>\u4e3a\u4e86\u7406\u89e3 C++ \u89e3\u91ca\u6709\u7b26\u53f7\u6574\u6570\u548c\u65e0\u7b26\u53f7\u6574\u6570\u4fee\u9970\u7b26\u4e4b\u95f4\u7684\u5dee\u522b\uff0c\u6211\u4eec\u6765\u8fd0\u884c\u4e00\u4e0b\u4e0b\u9762\u8fd9\u4e2a\u77ed\u7a0b\u5e8f\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4fee\u9970\u7b26\u7c7b\u578b \u5b9e\u4f8b<\/h2>\n\n\n\n<p>#include &lt;iostream&gt;\nusing namespace std;\n \n\/* \n * \u8fd9\u4e2a\u7a0b\u5e8f\u6f14\u793a\u4e86\u6709\u7b26\u53f7\u6574\u6570\u548c\u65e0\u7b26\u53f7\u6574\u6570\u4e4b\u95f4\u7684\u5dee\u522b\n*\/\nint main()\n{\n   short int i;           \/\/ \u6709\u7b26\u53f7\u77ed\u6574\u6570\n   short unsigned int j;  \/\/ \u65e0\u7b26\u53f7\u77ed\u6574\u6570\n \n   j = 50000;\n \n   i = j;\n   cout &lt;&lt; i &lt;&lt; &#8221; &#8221; &lt;&lt; j;\n \n   return 0;\n}<\/p>\n\n\n\n<p>\u5f53\u4e0a\u9762\u7684\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u4f1a\u8f93\u51fa\u4e0b\u5217\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">-15536 50000<\/pre>\n\n\n\n<p>\u4e0a\u8ff0\u7ed3\u679c\u4e2d\uff0c\u65e0\u7b26\u53f7\u77ed\u6574\u6570 50,000 \u7684\u4f4d\u6a21\u5f0f\u88ab\u89e3\u91ca\u4e3a\u6709\u7b26\u53f7\u77ed\u6574\u6570 -15,536\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">C++ \u4e2d\u7684\u7c7b\u578b\u9650\u5b9a\u7b26<\/h2>\n\n\n\n<p>\u7c7b\u578b\u9650\u5b9a\u7b26\u63d0\u4f9b\u4e86\u53d8\u91cf\u7684\u989d\u5916\u4fe1\u606f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><th>\u9650\u5b9a\u7b26<\/th><th>\u542b\u4e49<\/th><\/tr><tr><td>const<\/td><td><strong>const<\/strong>&nbsp;\u7c7b\u578b\u7684\u5bf9\u8c61\u5728\u7a0b\u5e8f\u6267\u884c\u671f\u95f4\u4e0d\u80fd\u88ab\u4fee\u6539\u6539\u53d8\u3002<\/td><\/tr><tr><td>volatile<\/td><td>\u4fee\u9970\u7b26&nbsp;<strong>volatile<\/strong>&nbsp;\u544a\u8bc9\u7f16\u8bd1\u5668\u4e0d\u9700\u8981\u4f18\u5316volatile\u58f0\u660e\u7684\u53d8\u91cf\uff0c\u8ba9\u7a0b\u5e8f\u53ef\u4ee5\u76f4\u63a5\u4ece\u5185\u5b58\u4e2d\u8bfb\u53d6\u53d8\u91cf\u3002\u5bf9\u4e8e\u4e00\u822c\u7684\u53d8\u91cf\u7f16\u8bd1\u5668\u4f1a\u5bf9\u53d8\u91cf\u8fdb\u884c\u4f18\u5316\uff0c\u5c06\u5185\u5b58\u4e2d\u7684\u53d8\u91cf\u503c\u653e\u5728\u5bc4\u5b58\u5668\u4e2d\u4ee5\u52a0\u5feb\u8bfb\u5199\u6548\u7387\u3002<\/td><\/tr><tr><td>restrict<\/td><td>\u7531&nbsp;<strong>restrict<\/strong>&nbsp;\u4fee\u9970\u7684\u6307\u9488\u662f\u552f\u4e00\u4e00\u79cd\u8bbf\u95ee\u5b83\u6240\u6307\u5411\u7684\u5bf9\u8c61\u7684\u65b9\u5f0f\u3002\u53ea\u6709 C99 \u589e\u52a0\u4e86\u65b0\u7684\u7c7b\u578b\u9650\u5b9a\u7b26 restrict\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-content\/uploads\/2016\/03\/2014032it-1024x631.jpg\" alt=\"IT\u96fb\u8166\u88dc\u7fd2, IT Teacher IT Freelance C++ ,C\u8bed\u8a00, \u96fb\u8166\u73ed, C\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00, C\/C++\u96fb\u8166\u73ed, \u96fb\u8166\u8ab2\u7a0b, \u96fb\u8166\u8ab2\u7a0b, C++\u88dc\u7fd2\u6559\u5b78, C++\u88dc\u7fd2,C++\u7a0b\u5f0f\u7de8\u5beb,C++\u8ab2\u7a0b\u88dc\u7fd2,C++, \u5927\u5b78\u751fC++\u8ab2\u7a0b ,C++1 \u5c0d 1 \u79c1\u4eba\u96fb\u8166\u8ab2\u7a0b, C++1 \u5c0d 1 \u79c1\u4eba\u96fb\u8166\u88dc\u7fd2,C++\u79c1\u4eba\u88dc\u7fd2, C++\u96fb\u8166\u8208\u8da3\u73ed, C++\u96fb\u8166\u88dc\u7fd2\u73ed\" class=\"wp-image-8\"\/><\/figure>\n\n\n<p><!--EndFragment--><br>\n<br>\n<\/p>","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>C++ \u5141\u8bb8\u5728&nbsp;char\u3001int \u548c d <a class=\"mh-excerpt-more\" href=\"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/2020\/03\/21\/c-type\/\" title=\"C++ \u4fee\u9970\u7b26\u7c7b\u578b\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":14,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"C++ \u4fee\u9970\u7b26\u7c7b\u578b - ITTeacherITFreelance.hk","description":"C++ \u5141\u8bb8\u5728&nbsp; char\u3001int \u548c double &nbsp;\u6570\u636e\u7c7b\u578b\u524d\u653e\u7f6e\u4fee\u9970\u7b26\u3002\u4fee\u9970\u7b26\u7528\u4e8e\u6539\u53d8\u57fa\u672c\u7c7b\u578b\u7684\u542b\u4e49\uff0c\u6240\u4ee5\u5b83\u66f4\u80fd\u6ee1\u8db3\u5404\u79cd\u60c5\u5883\u7684\u9700\u6c42\u3002 \u4e0b\u9762\u5217\u51fa\u4e86\u6570\u636e\u7c7b\u578b\u4fee\u9970\u7b26\uff1a signed unsigned long short \u4fee\u9970\u7b26&nbsp; signed\u3001unsigned\u3001long \u548c short"},"footnotes":""},"categories":[1306],"tags":[],"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2573"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=2573"}],"version-history":[{"count":1,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2573\/revisions"}],"predecessor-version":[{"id":2574,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2573\/revisions\/2574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media\/14"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=2573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=2573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=2573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}