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

  1.                                                    // Example: 038 from Library Reference
  2. #include "..\3D-Ware\dddware.h"
  3. #include  <stdio.h>
  4. char      buffer[]={"TESTING"};                    // Define a text string.
  5. char      filename[]={"3d-ware.tmp"};              // Define a filename.
  6. short     filehandle;
  7. short  main(void)
  8. {
  9.   dddWriteFile(filename, buffer , 7);              // Create, open, write and then close a file.
  10.   filehandle = dddFopen(filename);                 // Open the file we created.
  11.   printf("\nfilehandle returned by dddFopen is  :- %d\n\n",filehandle);
  12.   if  (filehandle == -1)                           // If Fopen returns a -1 then an error has occured.
  13.   {
  14.     printf("Error opening file \"%s\".",filename); // Inform the user of the error.
  15.     return 1;                                      // Exit with error.
  16.   }
  17.   dddFclose(filehandle);                           // Close the file.
  18.   return 0;                                        // Success, so exit.
  19. }
  20.