Hello

Can someone tell me what this sort algorithm is called.?
And if possible a little bit of information about it...

void record_search(struct CdRecords cdDB[])
{
   system("CLS");
   int i;
   char name[20];
     
   printf("Enter Name:");
   scanf("%s", name);
   for(i = 0;i<datasize;i++)
   {
     if((strcmp(name,cdDB[i].Artist))==0)
     {
	 
         ENTER DATA TO BE DISPLAYED
	 }
   }
   printf("Press Enter To Continue");
  // fflush(stdin);
   getch();

}

Recommended Answers

All 5 Replies

I dont think it is a sorting function at all. All it does is ask the user for a name, searches the database for a match, and once a match is found display the information the user wants to see. Nope, no sort.

I dont think it is a sorting function at all. All it does is ask the user for a name, searches the database for a match, and once a match is found display the information the user wants to see. Nope, no sort.

My fault sorry,, i meant to ask what kind of SEARCH method is this... ?

My fault sorry,, i meant to ask what kind of SEARCH method is this... ?

Linear Search

Hey thanx for that one

also check this line out:

memset(cdDB,0,datasize*sizeof(struct CdRecords));

what does memset exactly do as i have neva encountered it before and want to know how it actually works.

Syntax

#include <string.h>
void *memset(void *s, int c, size_t n);

Description
memset() sets the first n bytes in memory area s to the value of c (converted to an
unsigned char). It returns s.

commented: Thanks +1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.