home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Madness
/
VRMAD96_ONE.ISO
/
virtek
/
libex
/
libex044.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-08-24
|
1KB
|
35 lines
// Example: 044 from Library Reference
#include "..\3D-Ware\dddware.h"
#include <stdio.h>
char buffer[]={"TESTING"};
char buffer2[7];
char filename[]={"3d-ware.tmp"};
short filehandle;
short main(void)
{
dddWriteFile(filename, buffer , 7); // Write out a temorary working file.
filehandle = dddFopen(filename);
if (filehandle == -1)
{
printf("Error opening file \"%s\".",filename);
return 1;
}
// Show the user what the original string of text is.
printf("\nThe Original string is :- %s\n",buffer);
dddStrnSet(buffer2, 0, 7); // Clear the buffer to zeros.
dddFseek(2,0,filehandle); // Start at beginning+2
dddFread(buffer2, 7, filehandle);
printf("\ndddFread read in the following string :- %s\n",buffer2);
dddStrnSet(buffer2, 0, 7);
dddFseek(2,0,filehandle); // Start at beginning+2
dddFseek(2,1,filehandle); // Start at current pos +2
dddFread(buffer2, 7, filehandle);
printf("\ndddFread read in the following string :- %s\n",buffer2);
dddStrnSet(buffer2, 0, 7);
dddFseek(-2,2,filehandle); // Start at end-2
dddFread(buffer2, 7, filehandle);
printf("\ndddFread read in the following string :- %s\n",buffer2);
dddFclose(filehandle); // Close the file.
return 0; // Exit.
}