{"id":338,"date":"2012-07-17T22:43:47","date_gmt":"2012-07-17T13:43:47","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=338"},"modified":"2014-02-06T23:42:36","modified_gmt":"2014-02-06T14:42:36","slug":"vc-64bit%e6%95%b4%e6%95%b0%e3%81%ae%e6%96%87%e5%ad%97%e5%88%97%e5%8c%96%e3%83%bb%e6%95%b4%e6%95%b0%e5%8c%96","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/338\/","title":{"rendered":"VC++ 64bit\u6574\u6570\u306e\u6587\u5b57\u5217\u5316\u30fb\u6574\u6570\u5316"},"content":{"rendered":"<h2 id=\"content_1_0\">64bit\u6574\u6570  <a class=\"anchor_super\" id=\"u3975e9c\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-30%2F2#u3975e9c\" title=\"u3975e9c\"> <\/a><\/h2>\n<p>\u901a\u5e38C++\u306a\u3069\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u6574\u6570\u306e\u6700\u5927\u306f\u3001int\u3084long\u306732bit(4G)\u3067\u3042\u308b\u304c\u3001\u6628\u4eca\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u4e8b\u60c5\u306a\u3069\u3092\u898b\u3066\u3082\u305d\u308c\u4ee5\u4e0a\u306e\u5024\u3092\u6271\u3044\u305f\u3044\u5834\u5408\u304c\u3042\u308b\u306e\u306f\u3088\u304f\u3042\u308b\u3053\u3068\u3067\u3042\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u305d\u3053\u3067\u4f7f\u3046\u306e\u304c<strong>64bit\u6574\u6570<\/strong>\u3002.net framework\u306a\u3069\u3067\u306f\u6700\u521d\u304b\u3089\u898f\u5b9a\u3055\u308c\u3066\u3044\u308b\u304c\u3001VC++\u306b\u3042\u305f\u3063\u3066\u306f<strong>__int64<\/strong>\u3068\u3044\u3046\u306e\u3092\u4f7f\u3046\u3002\u3053\u308c\u306f\u8272\u3093\u306a\u3068\u3053\u308d\u3067typedef\u3084define\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u3066\u3001\u4f8b\u3048\u3070\u3001<strong>LONGLONG<\/strong>\u306f\u901a\u5e38__int64\u3067\u3042\u308b(86\u7528\u30d7\u30ed\u30bb\u30c3\u30b5\u6307\u5b9a_M_IX86\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u6642)\u3002\u307e\u305f\u3001\u30d5\u30a1\u30a4\u30eb\u30dd\u30b8\u30b7\u30e7\u30f3\u3092\u6271\u3046\u305f\u3081\u306e<strong>fpos_t<\/strong>\u3082__int64\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b(Microsoft\u8a00\u8a9e\u62e1\u5f35\u6307\u5b9a\u306e\u5834\u5408)\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">64bit\u6574\u6570-&gt;\u6587\u5b57\u5217  <a class=\"anchor_super\" id=\"e169f2f4\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-30%2F2#e169f2f4\" title=\"e169f2f4\"> <\/a><\/h2>\n<p>\u6587\u5b57\u5217\u3078\u306e\u5909\u63db\u306f\u3001<strong>printf<\/strong>\u3084<strong>sprintf<\/strong>\u3084<strong>CString::Format<\/strong>\u306a\u3069\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u304c\u4f7f\u3048\u308b\u5834\u5408<\/p>\n<pre>printf( \"%I64d\", n );<\/pre>\n<p>\u3068\u3044\u3046\u98a8\u306b\u884c\u3046(n\u306f__int64)\u3002\u4f8b\u3048\u3070\u3001\u3053\u306e\u3068\u304d64bit\u6574\u6570\u306b\u3082\u304b\u304b\u308f\u3089\u305a<\/p>\n<pre>__int64 n1 = 1;\r\n__int64 n2 = 100;\r\n\r\nprintf( \"%d %d\", n1, n2 );<\/pre>\n<p>\u3068\u3057\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001\u5358\u306b\u300c1 0\u300d\u3068\u3057\u304b\u51fa\u529b\u3055\u308c\u306a\u3044\u30020\u306fn1\u306e\u4e0a\u4f4d32bit\u3092\u6574\u6570\u3068\u3057\u3066\u51fa\u529b\u3057\u305f\u5024\u3067\u3042\u308b\u3002\u3061\u306a\u307f\u306b\u300132bit\u3088\u308a\u5927\u304d\u306a\u5024\u3092\u30bb\u30c3\u30c8\u3059\u308b\u6642\u3001<\/p>\n<pre>__int64 n1 = 100000000000ll;<\/pre>\n<p>\u3068\u3044\u3046\u3088\u3046\u306b<strong>ll\u306e\u30b5\u30d5\u30a3\u30c3\u30af\u30b9<\/strong>(\u63a5\u5c3e\u8f9e)\u3092\u3064\u3051\u3066\u3082\u3088\u3044\u3002(Visual Studio 2005\u3067\u306f\u3001ll\u3092\u3064\u3051\u306a\u304f\u3066\u3082\u5927\u4e08\u592b\u3067\u3042\u3063\u305f)<\/p>\n<p>\u307e\u305f\u3001<strong>_i64toa<\/strong>\u306a\u3069\u3092\u4f7f\u3063\u3066\u3082\u51fa\u6765\u308b\u3002<a href=\"http:\/\/msdn2.microsoft.com\/ja-jp\/library\/yakksftt%28VS.80%29.aspx\" rel=\"nofollow\">MSDN<\/a>\u3092\u53c2\u7167\u3057\u3066<\/p>\n<blockquote>\n<p class=\"quotation\">\u305d\u306e\u7d50\u679c\u3092 (_itoa \u306e\u5834\u5408\u306f 33 \u6587\u5b57\u307e\u3067\u3001_i64toa \u304a\u3088\u3073 _ui64toa \u306e\u5834\u5408\u306f 65 \u6587\u5b57\u307e\u3067) str \u306b\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u300165\u6587\u5b57\u5206\u306e\u30d0\u30c3\u30d5\u30a1\u3092\u53d6\u3063\u3066\u304a\u304f\u3053\u3068\u304c\u5fc5\u8981\u306e\u3088\u3046\u3060\u3002_i64tot\u306a\u3069\u3067\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u30d0\u30c3\u30d5\u30a1\u30b5\u30a4\u30ba\u3082\u6e21\u3055\u308c\u308b\u306e\u3067\u5b89\u5fc3\u3057\u3066\u4f7f\u3048\u308b\u300210\u9032\u6570\u6587\u5b57\u5217\u306b\u5909\u63db\u3059\u308b\u5834\u5408\u3001\u3001\u3001<\/p>\n<pre>__int64 n = 0x1000000000000;\r\nTCHAR tc[ 65 ];\r\n_i64tot( n, tc, 10 );<\/pre>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_2\">\u6587\u5b57\u5217-&gt;64bit\u6574\u6570  <a class=\"anchor_super\" id=\"nefa65f1\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-30%2F2#nefa65f1\" title=\"nefa65f1\"> <\/a><\/h2>\n<p>\u3053\u3061\u3089\u306e\u65b9\u306f\u308f\u308a\u3068\u7c21\u5358\u3067\u3001<strong>_ttoi64<\/strong>\u3084<strong>_tstoi64<\/strong>\u306a\u3069\u3092\u4f7f\u3046\u3060\u3051\u3067\u3088\u3044\u3002<\/p>\n<pre>__int64 n = _tstoi64( tc );<\/pre>\n<p>\u306a\u304a\u3001_ttoi64\u3084_tstoi64\u306fUNICODE\u304b\u3069\u3046\u304b\u306b\u3088\u3063\u3066_atoi64\u3001_wtoi64\u3042\u305f\u308a\u306b\u5c55\u958b\u3055\u308c\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>64bit\u6574\u6570 \u901a\u5e38C++\u306a\u3069\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u6574\u6570\u306e\u6700\u5927\u306f\u3001int\u3084long\u30673 &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/338\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=338"}],"version-history":[{"count":3,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":3315,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/338\/revisions\/3315"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}