Trying to scanf to a struct, but when compiling, I am given: 'request for member 'track' in something not a structure or union.
I have looked around on the internet and one suggestion was to replace the '.' with '->', which did not help. I have a feeling it is to do with where and how I have placed the struct, as example codes seem to place them in a different 'main'. Also, I am unsure if I should be entering an array number into the 'scanf' if there is an 'if statement' specifically for array entry.
Thank you! I hope what I have asked makes sense.
Here is the code, excluding the majority of the switch statement:
#include <windows.h>//for changing colour
struct song //creates a struct called song
system("color f5");//gives the window a white background (f) and purple text (5)
int menu, option, playchoice;
printf("Make a selection\n\n");
scanf("%d", &menu );
switch( menu )
printf("Number of tracks to add: \n\n");
printf("Filepath for track to add: \n\n");
scanf("%s", song.track]; //references to the first record and its first variable
printf("Name of track: \n\n");
for(i=0;i<qtyadd && i<99;i++)
struct song songs;
for(i=0;i<qtyadd && i<99;i++) ;