convert read in C to C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any equivalent in C# to this statement in C

read(fd,idxs,30*sizeof(unsigned int));

where idxs =(unsigned int *) calloc(30,sizeof(unsigned int)); ?

Bascially, I have an array of unsigned integers in C#. I would like to read
an array of bytes from a file an immediately insert it into the array idxs.
Is this possible?
 
My C is real, real rusty. But the BinaryReader has overrides
to deal with specific byte placement.
 
Mimi said:
Is there any equivalent in C# to this statement in C

read(fd,idxs,30*sizeof(unsigned int));

where idxs =(unsigned int *) calloc(30,sizeof(unsigned int)); ?

Bascially, I have an array of unsigned integers in C#. I would like to read
an array of bytes from a file an immediately insert it into the array idxs.
Is this possible?


If you want to read UInt32s, use BinaryReader's ReadUInt32.

John
 
Back
Top