Files
Cnomicon/utils/bin2c/bin2c.c
2021-01-22 10:16:20 -05:00

23 lines
267 B
C

#include <stdio.h>
int main( int argc, char *argv[] )
{
int c;
int n = 0;
printf( "\t" );
while ( (c = getchar()) !=EOF )
{
if ( n )
{
printf( ", " );
if ( n % 8 == 0 )
printf( "\n\t" );
}
printf( "0x%02x", c );
n++;
}
printf( "\n" );
}