Hello!
I am trying to create a loop that searches a struct array for the value of 'remove' (which is a char).
Struct:
Code:
typedef struct
{
char track[99];
char trackname[99];
char artist[99];
char genre[99];
} song; //creates a struct called song;
song songs[99];
Code to search for a track name:
Code:
int i;
for(i=0;i<99;i++)
{
if(*songs[i].trackname == remove)
{
printf("found it");
}
}
}
The problem is that I am told 'comparison between pointer and integer'. I could remove the '*', but will then be told 'comparison of distinct pointer types lacks a cast'.
I am assuming that 'song[i] and trackname are variable types that cannot be compared? I don't really know what the '*' does, but I saw it on some site discussing this problem so thought I might try it lol.