Initial commit of files
This commit is contained in:
22
utils/bin2c/bin2c.c
Normal file
22
utils/bin2c/bin2c.c
Normal file
@ -0,0 +1,22 @@
|
||||
#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" );
|
||||
}
|
||||
Reference in New Issue
Block a user