#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

WaltP commented: No CODE Tags; ASAP; No explanation; -- all bad. A terrible post. -4

Recommended Answers

All 5 Replies

Your kidding right? Demanding free help.

no i have been trying since 4 days but failed :(

Your kidding right? Demanding free help.

please help :)

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.