How to search in struct in c?

Hi, I learned struct recently, however, I don't know how to search something in struct.
Here's my attempt.
I actually want to search the performer's name, and the song written by the performer will come out as output.
Example, I search "BTS", the song "Fire" will come out in output.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#pragma warning(disable : 4996)

typedef struct {char performerName[30], songName[30]; int year, playTime, count;} Songs;

main() {
	
	Songs songList[10] = {{"Ed Sheeran\t", "Perfect Place", 2019, 253}, {"BTS\t\t","Fire\t",2016, 209}, {"Taylor Swift\t", "Love Story", 2008, 260}, {"Earth, Wind & Fire", "September", 1978, 288}, {"Imagine Dragons\t", "Believer", 2017, 204}, {"Neoni\t\t","Loser\t", 2021, 201}, {"Imagine Dragons\t", "Enemy\t", 2021, 174}, {"Mona\t\t", "ABC\t", 2012, 92}, {"MariahCareyVEVO\t", "Star\t", 2017, 242}, {"Adele\t\t", "Hello\t", 2015, 295}};
	Songs total, search;
	total.count = 0;

	printf("Performer's Name to search > ");
	scanf(" %[^\n]", &search.performerName);


	printf("Song\t\tYear released\t\tPlaying Time\n");
	printf("---------------------------------------------------------------------\n");
	for (int i = 0; i < 10; i++) {

		//if (strcmp(songList[i].performerName, search.performerName) == 0) {
		if (strcmp(songList[i].performerName, search.performerName) == 0) {

		printf("%s\t%d\t\t%ds\n", songList[i].songName, songList[i].year, songList[i].playTime);
		total.count += 1;

		}
	
	}

	printf("---------------------------------------------------------------------\n");

	printf("%d records found for Performer's Name = %s\n", total.count, search.performerName);

	system("pause");
}
Don't include \t with the performer name or song name. This will be included for the purpose of the comparison - so the comparison is likely always to fail. Also count would be a separate variable and not part of the struct. Similarly search would be it's own variable of type char[30].
exact string searching is painful to the user. the caps/lower letters have to match, spaces have to match, and so on. A user not knowing exactly how you put in earth wind and fire would never find them, for example.
its probably not important to the exercise, but this is a real life aggravation.
Topic archived. No new replies allowed.