C to C# code

Правка en1, от 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!

Теги c++, c#, file

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский TTMMM 2022-04-16 13:40:37 436 Initial revision (published)