home *** CD-ROM | disk | FTP | other *** search
- // Example: 038 from Library Reference
- #include "..\3D-Ware\dddware.h"
- #include <stdio.h>
- char buffer[]={"TESTING"}; // Define a text string.
- char filename[]={"3d-ware.tmp"}; // Define a filename.
- short filehandle;
- short main(void)
- {
- dddWriteFile(filename, buffer , 7); // Create, open, write and then close a file.
- filehandle = dddFopen(filename); // Open the file we created.
- printf("\nfilehandle returned by dddFopen is :- %d\n\n",filehandle);
- if (filehandle == -1) // If Fopen returns a -1 then an error has occured.
- {
- printf("Error opening file \"%s\".",filename); // Inform the user of the error.
- return 1; // Exit with error.
- }
- dddFclose(filehandle); // Close the file.
- return 0; // Success, so exit.
- }
-