T Tim Conner Oct 5, 2003 #1 Is there any method that allows me have access to the individual bytes that compounds a char variable ? Regards,
Is there any method that allows me have access to the individual bytes that compounds a char variable ? Regards,
W William Ryan Oct 5, 2003 #2 http://msdn.microsoft.com/library/d...l/frlrfsystemiobinaryreaderclassreadtopic.asp
M Mattias Sjögren Oct 5, 2003 #3 Tim, Is there any method that allows me have access to the individual bytes that compounds a char variable ? Click to expand... ((byte)c) and ((byte)(c>>8)) Mattias
Tim, Is there any method that allows me have access to the individual bytes that compounds a char variable ? Click to expand... ((byte)c) and ((byte)(c>>8)) Mattias
J Jay B. Harlow [MVP - Outlook] Oct 5, 2003 #4 Tim, Have you tried the System.BitConverter.GetBytes method. It returns a byte array given most built-in types. Hope this helps Jay
Tim, Have you tried the System.BitConverter.GetBytes method. It returns a byte array given most built-in types. Hope this helps Jay
E Eric Gunnerson [MS] Oct 6, 2003 #5 characters in C# are unicode, which means they're 16 bits, rather than 8 bits. You can access them with array syntax, or with foreach syntax. If you want to pull out the numeric value, you can then cast to a short or ushort.
characters in C# are unicode, which means they're 16 bits, rather than 8 bits. You can access them with array syntax, or with foreach syntax. If you want to pull out the numeric value, you can then cast to a short or ushort.