home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Madness / VRMAD96_ONE.ISO / virtek / libex / libex043.c < prev    next >
C/C++ Source or Header  |  1995-08-24  |  839b  |  24 lines

  1.                                       // Example: 043 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. char    buffer[]={"TESTING"};
  5. char    buffer2[7];
  6. char    filename[]={"3d-ware.tmp"};
  7. short   filehandle;
  8. short  main(void)
  9. {
  10.   dddWriteFile(filename, buffer , 7); // Write a temorary working file to disk.
  11.   filehandle = dddFopen(filename);    // Open the file.
  12.   if  (filehandle == -1)
  13.   {
  14.     printf("Error opening file \"%s\".",filename);
  15.     return 1;
  16.   }
  17.   dddStrnSet(buffer2, 0, 7);          // Clear the buffer to zeros.
  18.   dddFread(buffer2, 7, filehandle);   // Read in the working file.
  19.   dddFclose(filehandle);
  20.                                       // Print the loaded file for the user to see.
  21.   printf("\ndddFread read in the following string :- %s\n",buffer2);
  22.   return 0;
  23. }
  24.