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

  1.                                                       // Example: 042 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. char    buffer[]={"TESTING"};
  5. char    filename[]={"3d-ware.tmp"};
  6. short   filehandle;
  7. short  main(void)
  8. {
  9.   dddWriteFile(filename, buffer , 7);                 // Write a temporary file to disk.
  10.   filehandle = dddFopen(filename);                    // Open the file.
  11.                                                       //  Print the file handle or the error code.
  12.   printf("\nfilehandle returned by dddFopen is  :- %d\n\n",filehandle);
  13.   if  (filehandle == -1)
  14.   {
  15.     printf("Error opening file \"%s\".",filename);    // Inform the user of an error.
  16.     return 1;                                         // Exit with error.
  17.   }
  18.   dddFclose(filehandle);                              // Close the file.
  19.   return 0;                                           // Success , so exit.
  20. }
  21.