[Solved] Compare char array [closed]
[ad_1] Assuming that CDdata[i].artist and search are char* or const char*, all you’re currently doing is comparing the pointers not the values. You need to use something like if (strcmp(CDdata[i].artist, search)) which will return 0 for equality. strcmp is a standard function in the C standard library. [ad_2] solved Compare char array [closed]