前回の記事ですが、内容が多すぎて結構雑かなーと思いました。 補足説明をいれておきます。m(__)m long型のサイズの違い C言語、C++ではlong型のサイズは実装系依存で、つまり実行する環境によって変わりますが、Visual Studioでx64アプリケーション(LPP64)をビルドした場合、long型は4バイトとなります。(LinuxやmacOSなどのLP64環境では8バイトのようです。) 一方、C#のlong型は8バイトとして定義されています。 参考:整数型の一覧表 (C# リファレンス) | Microsoft Docs 名前が同じだからといってC++のlongをC#側でlongで受けてしまうと、例えば配列の前半部分に予期しない大きな値が入り、後半部分に0で埋まった値が入っているなどの予期せぬ動作が起こったりします。 C++でlong型で定義した関数は、C#側はint型(Int