I'm trying to print my strings output into a separate file. The issue I'm running into right now is the fact that my code carries a function for a set of strings that adds dashed lines underneath my columns (purely cosmetics). How do I call this function inside my fprintf code?
#include <stdio.h>
/* function for the dash-line separators*/
void
dashes (void)
{
printf (" ---- ----- -------------------- --------------\n");
}
/* end of function definition */
/* main program */
#include <stdio.h>
#include <string.h>
int
main (void)
{
FILE *data_File;
FILE *lake_File;
FILE *beach_File;
FILE *ecoli_Report;
char fileName[10], lake_Table[15],beach_Table[15]; /*.txt file names */
char province[30] = ""; /*variable for the file Lake Table.txt*/
char beach[20]="",beach1[20]; /*variable for the file Beach Table.txt*/
char decision[15] = "CLOSE BEACH";
int lake_data=0,lake_x=0, beach_x=0, nr_tests=0; /* variables for the file july08.txt */
int province_data=0,prv_x=0; /* variables for the file Lake Table.txt */
int beach_data=0,bch_x=0; /* variables for the file Beach Table.txt*/
int j;
double sum, avg_x, ecoli_lvl;
printf ("Which month would you like a summary of? \nType month followed by date (i.e: july05): ");
gets(fileName);
/*Opening the files needed for the program*/
data_File = fopen (fileName, "r");
lake_File = fopen ("Lake Table.txt", "r");
beach_File = fopen ("Beach Table.txt", "r");
ecoli_Report = fopen ("Lake's Ecoli Levels.txt", "w");
fprintf (ecoli_Report,"\n Lake Beach Average E-Coli Level Recommendation\n");
fprintf (ecoli_Report,"%c",dashes());