I took code from online http://www.codewithc.com/quiz-game-mini-project-in-c/ and I was getting errors in the code, so I cut down the code. I am getting an error [undefined reference to: 'show_record'] I cannot solve. Any help or suggestions on how to solve this issue would be greatly appreciated.
Here is a snippet of the code:
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
void show_record();
void reset_score();
void help();
void edit_score(float, char[]);
int main()
{
int countr, r, r1, count, i, n;
float score;
char choice;
char playername[20];
mainhome:
system("clear");
printf("\n\t\t\t WELCOME ");
printf("\n\t\t\t to ");
printf("\n\t\t\t THE GAME ");
printf("\n\t\t > Press S to start the game");
printf("\n\t\t > Press V to view the highest score ");
printf("\n\t\t > Press R to reset score");
printf("\n\t\t > press H for help ");
printf("\n\t\t > press Q to quit ");
printf("\n\t\t________________________________________\n\n");
choice = toupper(getchar());
if (choice == 'V')
{
show_record();
goto mainhome;
}
void show_record()
{
system("clear");
char name[20];
float scr;
FILE *f;
f = fopen("score.txt", "r");
fscanf(f, "%s%f", &*name, &scr);
printf("\n\n\t\t*************************************************************");
printf("\n\n\t\t %s has secured the Highest Score %0.2f", name, scr);
printf("\n\n\t\t*************************************************************");
fclose(f);
getchar();
}
}