I want to print out the 32 bit binary for a int


#1

My old dll was using a mix. manage code

I have a int declare
I want to print out the 32 bit binary equ
How?


#2

I need the 32 bit disk representation. as it is printed to windows disk drive so if the value is 6 i need a 4 byte write
06 00 00 00


#3

You need to better explain your problem because right now it is not clear, where do you want to print it, to the file? or???

int is already 32 bit you don’t need to do anything to convert. If you want to print it to the disk file as series of bytes (binary), you just use fwrite

// C/C++ code, not AFL
int yourvar = 6;
FILE *fh = fopen("file.bin", "wb" ) ; // binary write
if( fh )
{
    fwrite( &yourvar, 4, 1, fh ); // write 4 bytes
    fclose( fh );
}

#4

That was it . I forgot the B in wb.
In my assembly program I dont use the b
Thanks
nick