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#で変数をいくつかのビットで初期化する方法を教えてください。たとえば、ビジュアルCでは次のように行われています。
char variablename:3;
ビット フィールドは C 言語の機能であり、C# には存在しません。代わりに、BitArray クラスまたは効率的な BitVector32 構造を検討してください。ビットフィールドはコストがかかることに注意してください。パフォーマンスが重要な場合は、byte または int を優先してください。