Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sprintf function

Status
Not open for further replies.

kreop

Technical User
Oct 9, 2005
14
JP
I have a question about sprintf function. It is correct that the function is for display a char continously depend on the int i within for loop. And, as a result, the file name Name will be written in directory folder as Name_data.
Code:
static char *DIR = "C:\\:***/***/Name_data";
static char Name[i][15]={  "***","***",....,"***"};

FILE *FileFunction(.....){File control for write or read

}
FILE    *output;
char    filename_output[100];
int i;
for(i=0;i<10;i++){
sprintf(filename_output,"%s/Min_%s",DIR,Name[i]);
output = FileFunction(filename_output,"w");
}
 
I don't see any questions being asked.
What exactly are you trying to do?
 
You can't have a directory name of C:\***\***\Name_data
 
I think the ***'s are just a bit of censorship for posting.

> C:\\:
This doesn't look like the start of a good filename.

> output = FileFunction(filename_output,"w");
So when does fclose(output) actually happen?

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top