What am i missing? This creates a file but does not write to it.
Code:
void foo (struct* current, char inputID) {
FILE *stdoutReport;
char *reportFile;
if (current != NULL) {
if (strcmp(current->categoryID, inputID) == 0) {
strncat(inputID, ".report\0", REPORT_SIZE);
reportFile = inputID;
stdoutReport = fopen(reportFile, "wa");
if (!stdoutReport)
printf("Error creating file. %s", reportFile);
fprintf(stdoutReport, "Category %s - %s - Detailed Report\n",
current->categoryID, current->categoryName);
fprintf(stdoutReport, "----------------------------");
fprintf(stdoutReport, "-----------------------------\n");