C to C# code

Revision en1, by TTMMM, 2022-04-16 13:40:37

Can someone please convert this short piece of C code to C# code.

int main(int argc) {
    
    FILE* f = fopen("xyz", "rb");
    uint32_t offset = 0;
    fseek(f, 0x3c, SEEK_SET);
    fread(&offset, sizeof(offset), 1, f);
    fseek(f, offset + 4, SEEK_SET);
    uint16_t machine = 0;
    fread(&machine, sizeof(machine), 1, f);
    printf("Machine: 0x%.4x\n", machine);
}

Thanks in advance!

Tags c++, c#, file

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English TTMMM 2022-04-16 13:40:37 436 Initial revision (published)