Home About

 February 16th, 2009

Uncommon C# : Using C style unions in C# - 1

Uncommon unions in C#

A union is a data structure that stores several different types of data at the same single location in memory. Although this might sound like madness in a garbage collected world many older binary data formats still heavily rely on this. A possible use is if you want to modify an IPv4 address. An IPv4 address is 4 bytes, or an unsigned C# int. You might want to manipulate the IP address as a single value, or by splitting it into four separate bytes.

Read the rest of this entry »


Most popular

    Sorry. No data so far.

Recent Comments
  • Juan Romero: Hi there, it’s a neat little class, but I believe you could do the same thing with the WebClient...
  • anthosh: Hey, THank you very much for your tutorial. It was awesome. But i have a problem that i am not able to...
  • bian: how to get passphase if i have encrypt and decrypt string?? Thanks alot
  • Michael: Hi, I really like your post, thanks a lot, it really helped clear up a few things I could not remember how...
  • Bharat Prajapati: i was trying to import keyword dictionary to this plugin which is in csv format, but i get an error...