home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / bin2obj.zip / EXAMPLE.ZIP / EXAMPLE.C next >
C/C++ Source or Header  |  1996-03-12  |  730b  |  26 lines

  1. #include <stdio.h>
  2.  
  3. /* These externs use the same name as that given to bin2obj */
  4. /* for the object files. */
  5. extern char SomeText[];
  6. extern char Letters[];
  7.  
  8. int main( void )
  9. {
  10.    puts( "Test of BIN2OBJ." );
  11.  
  12.    /* This first example shows a straight binary object. */
  13.    /* We have to already know the size of the data. */
  14.    puts( "\nUpper case to lower case:" );
  15.    fwrite( Letters, 1, 2*(26+2), stdout );
  16.  
  17.    /* This example shows one way to use the -n option in bin2obj, */
  18.    /* which puts the 4-byte count of bytes at the beginning of the data. */
  19.    puts( "\n**********" );
  20.    fwrite( SomeText+4, 1, *(int*)SomeText, stdout );
  21.    puts( "**********" );
  22.  
  23.    puts( "\nEnd of test" );
  24.    return 0;
  25. }
  26.