Click here to Skip to main content
15,499,723 members
Home / Discussions / C#
   

C#

 
QuestionWireless Sensor Node Simulation Time in C# Pin
Nico Encarnacion7-Mar-13 15:45
MemberNico Encarnacion7-Mar-13 15:45 
AnswerRe: Wireless Sensor Node Simulation Time in C# Pin
Gerry Schmitz7-Mar-13 19:49
mveGerry Schmitz7-Mar-13 19:49 
GeneralRe: Wireless Sensor Node Simulation Time in C# Pin
Nico Encarnacion12-Mar-13 21:05
MemberNico Encarnacion12-Mar-13 21:05 
GeneralRe: Wireless Sensor Node Simulation Time in C# Pin
Gerry Schmitz13-Mar-13 13:10
mveGerry Schmitz13-Mar-13 13:10 
QuestionExplicit type-casting of pointer Pin
Flo_897-Mar-13 12:18
MemberFlo_897-Mar-13 12:18 
AnswerRe: Explicit type-casting of pointer Pin
Gerry Schmitz7-Mar-13 13:23
mveGerry Schmitz7-Mar-13 13:23 
GeneralRe: Explicit type-casting of pointer Pin
Flo_897-Mar-13 13:24
MemberFlo_897-Mar-13 13:24 
AnswerRe: Explicit type-casting of pointer Pin
Matt T Heffron7-Mar-13 13:34
professionalMatt T Heffron7-Mar-13 13:34 
In general, c# (or any managed .NET language) does not have pointers.
(Yes, there's unsafe and IntPtr but that is not necessary to accomplish what you've described.)

The way to do this kind of thing in c# is to use the class System.BitConverter.
So to convert a byte[] into a float is:
C#
class Program
{
  static void Main(string[] args)
  {
    byte[] test = { 25, 4, 158, 63 };
    float p = BitConverter.ToSingle(test, 0);
    Console.WriteLine(p);
  }
}

Going the other way, from float to byte[], you would use BitConverter.GetBytes(value);
AnswerRe: Explicit type-casting of pointer Pin
harold aptroot7-Mar-13 22:57
Memberharold aptroot7-Mar-13 22:57 
QuestionHow to highlight word in word document using C# Pin
Tridip Bhattacharjee7-Mar-13 4:56
professionalTridip Bhattacharjee7-Mar-13 4:56 
AnswerRe: How to highlight word in word document using C# Pin
Richard MacCutchan7-Mar-13 6:13
mveRichard MacCutchan7-Mar-13 6:13 
GeneralRe: How to highlight word in word document using C# Pin
Tridip Bhattacharjee8-Mar-13 2:46
professionalTridip Bhattacharjee8-Mar-13 2:46 
GeneralRe: How to highlight word in word document using C# Pin
Richard MacCutchan8-Mar-13 3:16
mveRichard MacCutchan8-Mar-13 3:16 
QuestionRe: How to highlight word in word document using C# Pin
Alan N7-Mar-13 6:17
MemberAlan N7-Mar-13 6:17 
AnswerRe: How to highlight word in word document using C# Pin
Tridip Bhattacharjee8-Mar-13 2:47
professionalTridip Bhattacharjee8-Mar-13 2:47 
GeneralRe: How to highlight word in word document using C# Pin
Alan N8-Mar-13 4:12
MemberAlan N8-Mar-13 4:12 
QuestionC# file access Pin
classy_dog7-Mar-13 2:52
Memberclassy_dog7-Mar-13 2:52 
AnswerRe: C# file access Pin
Dave Kreskowiak7-Mar-13 3:30
mveDave Kreskowiak7-Mar-13 3:30 
AnswerRe: C# file access Pin
Matt T Heffron7-Mar-13 9:49
professionalMatt T Heffron7-Mar-13 9:49 
QuestionHow to use sql server database into oracle Pin
Arun kumar Gautam7-Mar-13 2:04
MemberArun kumar Gautam7-Mar-13 2:04 
AnswerRe: How to use sql server database into oracle Pin
Simon_Whale7-Mar-13 2:14
professionalSimon_Whale7-Mar-13 2:14 
AnswerRe: How to use sql server database into oracle Pin
jschell7-Mar-13 9:34
Memberjschell7-Mar-13 9:34 
AnswerRe: How to use sql server database into oracle Pin
Gerry Schmitz7-Mar-13 20:38
mveGerry Schmitz7-Mar-13 20:38 
QuestionRetrieve Mongodb Images using GridFS C# Winforms Pin
ArunRajendran16-Mar-13 20:38
MemberArunRajendran16-Mar-13 20:38 
AnswerRe: Retrieve Mongodb Images using GridFS C# Winforms Pin
Eddy Vluggen6-Mar-13 23:48
professionalEddy Vluggen6-Mar-13 23:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.