C# equivalent of a C++ union ???

  • Thread starter Thread starter Peter Olcott
  • Start date Start date
Peter said:
What is the C# equivalent of a C++ union ???

C# does not have unions.

To help you with an alternative we need to know the real
problem.

Depending on the circumstances BitConverter, BinaryReader/Writer
and StructLayout may all be solutions.

Arne
 
C# does not have unions.

To help you with an alternative we need to know the real
problem.

Depending on the circumstances BitConverter, BinaryReader/Writer
and StructLayout may all be solutions.

Arne

StructLayout is usually used for this purpose. Depends on requirements
it may change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C# Equivalent of C++ statement 1
Deduping with Linq / Where Exists 7
Union a Structure and Byte Array 3
C++ equivalent? 4
Defining a union 1
Collection of C# 5
Cast on C# 3
LSP to C# 0

Back
Top