Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はC++で次の関数を持っています:
void put8At ( unsigned char *b, int pos, int v ) { union { short a; unsigned char b[2]; } u; u.a = v; b += pos; *b = v & 0xff; }
これを C# でどのようにコーディングしますか?
これをC++でコーディングする方法は次のとおりです。
void put8At ( unsigned char *b, int pos, int v ) { b[pos] = v & 0xff; }
これはおそらく、C# に変換する方が簡単です。