{"id":4085,"date":"2021-04-28T10:40:18","date_gmt":"2021-04-28T01:40:18","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=4085"},"modified":"2024-08-06T16:46:25","modified_gmt":"2024-08-06T07:46:25","slug":"c-%e5%86%85%e9%83%a8%e7%b5%90%e5%90%88%e3%81%a8%e5%a4%96%e9%83%a8%e7%b5%90%e5%90%88","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/4085","title":{"rendered":"[C\/C++] \u5185\u90e8\u7d50\u5408\u3068\u5916\u90e8\u7d50\u5408"},"content":{"rendered":"<ul>\n<li>\u5185\u90e8\u7d50\u5408 : Internal Linkage<\/li>\n<li>\u5916\u90e8\u7d50\u5408 : External Linkage<\/li>\n<\/ul>\n<h2>\u30d5\u30a1\u30a4\u30eb\u30b9\u30b3\u30fc\u30d7\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5b9a\u7fa9\uff08\u3044\u308f\u3086\u308b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u5b9a\u7fa9\uff09<\/h2>\n<table>\n<tbody>\n<tr>\n<td>&nbsp;<\/td>\n<td align=\"center\">static<\/td>\n<td align=\"center\">\u8a18\u61b6\u30af\u30e9\u30b9\u6307\u5b9a\u5b50\u306a\u3057<\/td>\n<td align=\"center\">extern<\/td>\n<\/tr>\n<tr>\n<td align=\"right\">C\u8a00\u8a9e<\/td>\n<td align=\"center\">\u5185\u90e8\u7d50\u5408\u5b9a\u7fa9<\/td>\n<td align=\"center\">\u5916\u90e8\u7d50\u5408\u5b9a\u7fa9<\/td>\n<td align=\"center\">\u4ed5\u69d8\u306a\u3057<\/td>\n<\/tr>\n<tr>\n<td align=\"right\">C++<\/td>\n<td align=\"center\">\u5185\u90e8\u7d50\u5408\u5b9a\u7fa9<\/td>\n<td align=\"center\">\u975econst: \u5916\u90e8\u7d50\u5408\u5b9a\u7fa9<br \/>const: \u5185\u90e8\u7d50\u5408\u5b9a\u7fa9<\/td>\n<td align=\"center\">\u5916\u90e8\u7d50\u5408\u5b9a\u7fa9<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h2>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u5b9a\u7fa9<\/h2>\n<h3>\u8a18\u61b6\u57df\u30af\u30e9\u30b9\u6307\u5b9a\u5b50\u306a\u3057<\/h3>\n<pre class=\"lang:c++ decode:true \" >int global_variable = 0;<\/pre>\n<ul>\n<li>C\u8a00\u8a9e\u306f\u7121\u6761\u4ef6\u306b\u5916\u90e8\u7d50\u5408\u5b9a\u7fa9\n<ul>\n<li>\u3057\u305f\u304c\u3063\u3066C\u8a00\u8a9e\u3067\u306f &quot;<code>extern int global_variable = 0;<\/code>&quot; \u306e\u3088\u3046\u306a\u66f8\u304d\u65b9\u306f\u3057\u306a\u3044\uff08\u4ed5\u69d8\u672a\u5b9a\u7fa9\uff09<\/li>\n<\/ul>\n<\/li>\n<li>C++\n<ul>\n<li>\u975econst\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306f\u5916\u90e8\u7d50\u5408\u5b9a\u7fa9<\/li>\n<li>const\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306f\u5185\u90e8\u7d50\u5408\u5b9a\u7fa9<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>static\u8a18\u61b6\u57df\u30af\u30e9\u30b9<\/h3>\n<pre class=\"lang:c++ decode:true \" >static int internal_variable = 0;<\/pre>\n<ul>\n<li>C\u8a00\u8a9e\u3082C++\u3082\u5185\u90e8\u7d50\u5408\u5b9a\u7fa9<\/li>\n<\/ul>\n<h3>extern\u8a18\u61b6\u57df\u30af\u30e9\u30b9<\/h3>\n<pre class=\"lang:c++ decode:true \" >extern int external_variable = 0;<\/pre>\n<ul>\n<li>C++\u306f\u5916\u90e8\u7d50\u5408\u5b9a\u7fa9 \uff08const, \u975econst\u306b\u95a2\u308f\u3089\u305a\uff09<\/li>\n<li>C\u8a00\u8a9e\n<ul>\n<li>\u5b9a\u7fa9\u306bextern\u4fee\u98fe\u3057\u305f\u3068\u304d\u306e\u4ed5\u69d8\u306f\u672a\u5b9a\u7fa9<\/li>\n<li>extern\u4fee\u98fe\u5b50\u306f\uff08\u5916\u90e8\u7d50\u5408\uff09\u5ba3\u8a00\u306e\u30ad\u30fc\u30ef\u30fc\u30c9<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306e\u4eee\u5b9a\u7fa9<\/h2>\n<pre class=\"lang:c++ decode:true \" >int global_variable;<\/pre>\n<ul>\n<ul>\n<li>\u521d\u671f\u5316\u3057\u306a\u3044\u3068\u304d\u306f\u300e\u4eee\u5b9a\u7fa9\u300f\u3067\u3042\u308b\u3002<\/li>\n<li>\u305f\u3060\u4e00\u3064\u306e\u300e\u4eee\u5b9a\u7fa9\u300f\u3057\u304b\u5b58\u5728\u3057\u306a\u3044\u3068\u304d\u306f\u3001\u30a4\u30b3\u30fc\u30eb\u300e\u5b9a\u7fa9\u300f\u3068\u307f\u306a\u3059\u3002<\/li>\n<li>\u8907\u6570\u306e\u7ffb\u8a33\u5358\u4f4d\uff08\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5358\u4f4d\uff09\u306b\u8907\u6570\u306e\u4eee\u5b9a\u7fa9\u304c\u5b58\u5728\u3059\u308b\u3068\u304d\u306f\u3001\u3069\u308c\u304b\u4e00\u3064\u3092\u300e\u5b9a\u7fa9(definition)\u300f\u3068\u307f\u306a\u3057\u3001\u4ed6\u306f\u300e\u5ba3\u8a00(declaration)\u300f\u3068\u307f\u306a\u3059\u3002<\/li>\n<li>const\u4fee\u98fe\u3057\u305f\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u306f\u300e\u4eee\u5b9a\u7fa9\u300f\u3067\u306f\u306a\u304f\u3001\u5e38\u306b\u300e\u5b9a\u7fa9\u300f\u3068\u307f\u306a\u3055\u308c\u308b\u3002\u305d\u3053\u3067\u3001\u8907\u6570\u306e\u7ffb\u8a33\u5358\u4f4d\uff08\u305f\u3068\u3048\u3070\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\uff09\u306b\u91cd\u8907\u3059\u308b\u5b9a\u7fa9\u3092\u8a18\u8ff0\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\uff08\u591a\u91cd\u5b9a\u7fa9\uff09\u3068\u306a\u308b\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5185\u90e8\u7d50\u5408 : Internal Linkage \u5916\u90e8\u7d50\u5408 : External Linkage \u30d5\u30a1\u30a4\u30eb\u30b9\u30b3\u30fc\u30d7\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5b9a\u7fa9\uff08\u3044\u308f\u3086\u308b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\u5b9a\u7fa9\uff09 &nbsp; static \u8a18\u61b6\u30af\u30e9\u30b9\u6307\u5b9a\u5b50\u306a\u3057 exte [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[84,80],"class_list":["post-4085","post","type-post","status-publish","format-standard","hentry","category-memo","tag-cpp","tag-c"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/4085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=4085"}],"version-history":[{"count":16,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/4085\/revisions"}],"predecessor-version":[{"id":7085,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/4085\/revisions\/7085"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=4085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=4085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=4085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}