I'm getting an error:
1> Source.cpp 1>Source.obj : error LNK2019: unresolved external symbol "void __cdecl saveToFile(char const * const,struct Task * const,int)" (?saveToFile@@YAXQBDQAUTask@@H@Z) referenced in function _main 1>C:\Users\Evan\Desktop\Coding Stuff\C++ programs\CS162 HW\cs_162_hw_2\Debug\cs_162_hw_2.exe : fatal error LNK1120: 1 unresolved externals
and it only happens when i attempt to run my saveToFile function. Here is the code for that function:
void saveToFile(const char fileName[MAX_CHAR], const Task list[], int size)
{
ofstream out;
out.open(fileName);
if(!out)
{
cerr << "Fail to open " << fileName << " for writing!" << endl;
exit(1);
}
int index;
for(index=0; index < size; index++)
{
out << list[index].course << ';' << list[index].description << ';' << list[index].date << endl;
}
out.close();
}