{"id":6415,"date":"2019-03-02T17:17:37","date_gmt":"2019-03-02T08:17:37","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=6415"},"modified":"2023-05-27T18:31:24","modified_gmt":"2023-05-27T09:31:24","slug":"%e3%80%90c%e8%a8%80%e8%aa%9e%e3%80%91%e6%96%87%e5%ad%97%e5%88%97%e5%9e%8b%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=6415","title":{"rendered":"\u3010C\u8a00\u8a9e\u3011\u5909\u6570\u306e\u578b\u3001\u6587\u5b57\u5217\u578b\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u4e3b\u306a\u5909\u6570\u306e\u578b\u306b\u3064\u3044\u3066<\/h2>\n<p>\u300c\u6d88\u8cbb\u30d0\u30a4\u30c8\u300d\u306b\u3064\u3044\u3066\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u30b3\u30f3\u30d1\u30a4\u30e9\u3084CPU\u306b\u3088\u3063\u3066\u30b5\u30a4\u30ba\u304c\u5909\u66f4\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/strong><\/span>\u78ba\u5b9f\u306e\u5b9f\u884c\u74b0\u5883\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u30d0\u30a4\u30c8\u6570\u304c\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300csizeof\u95a2\u6570\u300d<\/strong><\/span>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u5206\u985e<\/th>\n<th>\u578b\u540d<\/th>\n<th>\u7bc4\u56f2\uff08\u7528\u9014\u4f8b\uff09<\/th>\n<th>\u6d88\u8cbb\u30d0\u30a4\u30c8<\/th>\n<\/tr>\n<tr>\n<td>\u6574\u6570<\/td>\n<td>char<\/td>\n<td>-127\uff5e127\uff08\u4f8b\uff1a\u5bb6\u65cf\u306e\u4eba\u6570\uff09<\/td>\n<td>1\u30d0\u30a4\u30c8<\/td>\n<\/tr>\n<tr>\n<td>\u6574\u6570<\/td>\n<td>int<\/td>\n<td>-214783648\uff5e214783647\uff08\u4f8b\uff1a\u5e74\u9f62\u7b49\uff09<\/td>\n<td>4\u30d0\u30a4\u30c8<\/td>\n<\/tr>\n<tr>\n<td>\u6574\u6570<\/td>\n<td>long<\/td>\n<td>-2147483648\uff5e2147483647\u672a\u6e80\u306e\u6570\u5024\uff08\u4f8b\uff1a\u4e16\u754c\u4eba\u53e3\u7b49\uff09<\/td>\n<td>4\u30d0\u30a4\u30c8\/8\u30d0\u30a4\u30c8<\/td>\n<\/tr>\n<tr>\n<td>\u5c0f\u6570<\/td>\n<td>float<\/td>\n<td>\u4f53\u91cd<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u5c0f\u6570<\/td>\n<td>double<\/td>\n<td>\u7279\u5225\u306a\u4e8b\u60c5\u304c\u306a\u3044\u9650\u308a\u3001<span style=\"color: #ff0000;\"><strong>\u5c0f\u6570\u306ffloat\u3067\u306f\u306a\u304f\u3053\u3061\u3089<\/strong><\/span>\u3092\u4f7f\u3046\u3002<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u771f\u507d\u5024<\/td>\n<td>bool<\/td>\n<td>true or false<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>\u6587\u5b57<\/td>\n<td>char<\/td>\n<td>\u534a\u89d2\u306e\u6587\u5b57<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u6574\u6570\u7cfb\u306e\u6587\u5b57\u578b\u306b\u3064\u3044\u3066<\/h3>\n<h4>unsigned\u578b<\/h4>\n<p>unsigned\u578b\u3092\u30c7\u30fc\u30bf\u578b\u306e\u5148\u982d\u306b\u4ed8\u3051\u308b\u3053\u3068\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u30d7\u30e9\u30b9\u306e\u307f\u306e\u5024\u3092\u6271\u3044\u3001\u30d7\u30e9\u30b9\u65b9\u5411\u306b\u5024\u3092\u6271\u3048\u308b\u7bc4\u56f2\u3092\u5897\u3084\u3059\u3053\u3068\u304c\u53ef\u80fd<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001char\u578b\u306bunsigned\u3092\u3064\u3051\u308b\u3068\u901a\u5e38\u306f\u3001-128\uff5e127\u306e\u7bc4\u56f2\u306a\u306e\u3067\u3059\u304c\u3001\u300c0\uff5e255\u300d\u306b\u62e1\u5927\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h4>\u6628\u4eca\u306b\u3064\u3044\u3066<\/h4>\n<p>\u6614\u306f\u3001int\u4ee5\u4e0b\u306echar\u5909\u6570\u3082\u4f7f\u3063\u305f\u308a\u30012\u30d0\u30a4\u30c8\u4ee5\u4e0b\u306e\u5909\u6570\u3082\u4f7f\u3044\u5206\u3051\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u6628\u4eca\u3067\u306f\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306e\u6027\u80fd\u304c\u4e0a\u304c\u3063\u3066\u304a\u308a\u3001\u6574\u6570char\u578b\u3084\u3001short\u578b\u3092\u4f7f\u3046\u3088\u308a\u30824\u30d0\u30a4\u30c8\u306eint\u578b\u3092\u4f7f\u3046\u65b9\u304c\u52b9\u7387\u304c\u3088\u304f\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001<span style=\"color: #ff0000;\"><strong>\u5c11\u306a\u3044\u6841\u6570\u306e\u6574\u6570\u306e\u5834\u5408\u3067\u3082\u57fa\u672c\u7684\u306b\u306fint\u578b\u3092\u4f7f\u3046<\/strong><\/span>\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u306b\u3064\u3044\u3066<\/h4>\n<p>\u5909\u6570\u306e\u5024\u306b\u3001\u683c\u7d0d\u3067\u304d\u308b\u5024\u3092\u8d85\u3048\u3066\u683c\u7d0d\u3057\u305f\u5834\u5408\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc<\/strong><\/span>\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<p>C\u8a00\u8a9e\u306e\u5834\u5408\u306f\u3001\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3001\u5909\u6570\u306e\u5024\u304c\u58ca\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u305d\u306e\u307e\u307e\u7d9a\u884c\u3057\u7d9a\u3051\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/strong><\/span><\/p>\n<p>\u975e\u5e38\u306b\u5371\u967a\u306a\u306e\u3067\u3001\u8a2d\u8a08\u6bb5\u968e\u3067\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u304c\u8d77\u304d\u306a\u3044\u3088\u3046\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u6d6e\u52d5\u5c0f\u6570\u70b9\uff08\u5c0f\u6570\uff09\u7cfb\u306e\u6587\u5b57\u578b\u306b\u3064\u3044\u3066<\/h3>\n<p>\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u53b3\u5bc6\u306a\u8a08\u7b97\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u53b3\u5bc6\u306a\u8a08\u7b97\u304c\u5fc5\u8981\u306b\u306a\u3063\u3066\u304f\u308b\u3088\u3046\u306a\u91d1\u984d\u306e\u8a08\u7b97\u7b49\u306b\u306ffloat\u578b\u3084double\u578b\u306f\u7528\u3044\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<h2>\u6587\u5b57\u5217\u306e\u578b<\/h2>\n<p>C\u8a00\u8a9e\u3067\u306f\u3001\u534a\u89d2\u6587\u5b57\u3092\u6271\u3046char\u578b\u306f\u3042\u308a\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>Java\u7b49\u306e\u4ed6\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u3092\u6271\u3046\u305f\u3081\u306e\u30c7\u30fc\u30bf\u578b\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/strong><\/span><\/p>\n<p>\u6587\u5b57\u5217\u578b\u3068\u540c\u3058\u3088\u3046\u306a\u7269\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u3001C\u8a00\u8a9e\u3067\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3092\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">#include &lt;stdio.h&gt;\r\n\r\ntypedef char String[1024];\r\n\r\nint main(void)\r\n{\r\n\tString str = \"Hello World!\";\r\n\t\r\n\tprintf(\"%s\\n\",str);\r\n\t\r\n\treturn 0;\r\n}\r\n<\/pre>\n<h3>typedef\u5ba3\u8a00<\/h3>\n<p>String\u578b\u3092\u5ba3\u8a00\u3059\u308b\u969b\u306b\u3001<span style=\"color: #ff0000;\">typedef<\/span>\u3068\u3044\u3046\u69cb\u6587\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u3061\u3089\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u65e2\u5b58\u306e\u578b\u306b\u5bfe\u3057\u3066\u5225\u540d\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u578b<\/strong><\/span>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u4f8b\u3067\u3044\u3048\u3070\u3001char\u578b\u306e\u914d\u5217\u3067\u3042\u308b\u300cchar[1024]\u300d\u306b\u5bfe\u3057\u3066String\u3068\u3044\u3046\u5225\u540d\u3092\u3064\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38\u306e\u30c7\u30fc\u30bf\u578b\u4ee5\u5916\u306b\u3082\u3001\u69cb\u9020\u4f53\u7b49\u69d8\u3005\u306a\u5225\u540d\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u6587\u5b57\u5217\u578b\u3092\u4f7f\u3046\u5834\u5408\u306e\u6ce8\u610f\u70b9\uff08\u3068\u3044\u3046\u304b\u5236\u7d04\uff09<\/h3>\n<p>\u4e0a\u8a18\u69cb\u6587\u3092\u4f7f\u3048\u3070\u3001C\u8a00\u8a9e\u3067\u3082\u6587\u5b57\u5217\u578b\u3092\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u3044\u304f\u3064\u304b\u306e\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>1024\u3088\u308a\u5c0f\u3055\u3044\u5024\u3092\u4ee3\u5165\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3002<\/li>\n<li>\u521d\u671f\u5316\u6642\u306b\u3057\u304b\u4ee3\u5165\u3067\u304d\u306a\u3044\u3002<\/li>\n<li>\u4e8c\u3064\u306e\u6587\u5b57\u5217\u306f\u3001\u30d7\u30e9\u30b9\u6f14\u7b97\u5b50\u3067\u9023\u7d50\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3002<\/li>\n<li>\u6587\u5b57\u5217\u540c\u58eb\u3092==\u6f14\u7b97\u5b50\u3067\u6bd4\u8f03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u4e3b\u306a\u5909\u6570\u306e\u578b\u306b\u3064\u3044\u3066 \u300c\u6d88\u8cbb\u30d0\u30a4\u30c8\u300d\u306b\u3064\u3044\u3066\u306f\u3001\u30b3\u30f3\u30d1\u30a4\u30e9\u3084CPU\u306b\u3088\u3063\u3066\u30b5\u30a4\u30ba\u304c\u5909\u66f4\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u78ba\u5b9f\u306e\u5b9f\u884c\u74b0\u5883\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u30d0\u30a4\u30c8\u6570\u304c\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u300csizeof\u95a2\u6570\u300d\u3092\u4f7f\u3044\u307e\u3059\u3002 \u5206\u985e \u578b\u540d \u7bc4\u56f2\uff08\u7528\u9014 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[74],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6415"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6415"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6415\/revisions"}],"predecessor-version":[{"id":20150,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/6415\/revisions\/20150"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6415"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}