-2

#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

Comments
No CODE Tags; ASAP; No explanation; -- all bad. A terrible post.
4
Contributors
5
Replies
6
Views
4 Years
Discussion Span
Last Post by Ancient Dragon
0

Just visually inspecting this, some definitions are missing:

vfpf(“%s %f %s”, stop, move, boom); // is this supposed to be vfpf(“%s %f %s”, stop, move, boom);
tpfyl(); //where is this function?
//tpm //Is this supposed to be file the pointer (fp)?

The compiler will tell you the line that has the first problem.
Fix that line first, then move to the next one after you re-compile.

0

Your program is missing some header files that your compiler should have complained about. For example, va_start is undefined because you failed to include the header file that defines it. Learn to use google to find out where va_start is declared. You will save yourself an awful lot of time and grief if you start using google or another search engine more effectively.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.