#include “iostream.h”
#include “stdlib.h”
#include “conio.h>”
file *fp;
int vfprf(char *fmt, …)
{
va_list argptr;
int cnt;
va_start(argptr, fmt);
cnt = vprintf(fp, fmt, argptr);
v_end(agptr);
return(cnt);
}
int main(void)
{
char *stop = “damn”;
float move = 42.6;
char *boom = “doomed”;
fp = tpfyl();
if (fp == null)
{
perror(“tpfyl() call”);
exit(1);
}
vfpf(“%s %f %s”, stop, move, boom);
rewind(tpm);
fscanf(fp,”%s %f %s”, stop, &move, boom);
printf(“%s %f %s\n”, stop, move, boom);
pclose(fp);
return 0;
getch();
} //end