index sequential search

hey the foll is the program i did for index sequential search.And i have used a function called getline but its giving a error that unable to call function getline.So which header file i should use??
#include
#include
#include
struct emp
{
int eid;
int sal;
char name[15],desg[15];
}e[10],*p,temp;
struct index
{
 int eid;
 struct emp *link;
}ind[10];
void main()
{
  int n,i=0,j=0,x;
  char option;
  while(1)
        {
         printf("\n enter the ID,name,designation and salary");
         scanf("%d%s%s%d",&e[i].eid,&e[i].name,&e[i].desg,&e[i].sal);
         ind[i].eid=e[i].eid;
         ind[j].link=&e[i];
         i++;j++;
         printf("\n do you want to add another record(y/n):");
         scanf("%s",&option);
         if(option=='n')
            {
             break;
            }
        }
   n=i;
  printf("\n enter the id of the employ to be searched: ");
  scanf("%d",&x);
  for(i=0;ieid,p->name,p->desg,p->sal);
         }
      }
  if(i==n)
     {
      printf("Plz enter the correct ID");
     }
getch();
}

Replies

  • dipen30
    dipen30
    you have to include "iostream.h"
  • samaira
    samaira
    yes i did that but still getting that error😕
  • Manish Goyal
    Manish Goyal
    use fstream.h
  • samaira
    samaira
    sorry it was my mistake.I asked maam abt my problem and she said that since it is a c code it has no function called getline.Its in c++.SO i can run the program successfully without using it.And i did it.
    so thanks for the help😛

You are reading an archived discussion.

Related Posts

during surfing i found about Programming Contest for Engineering and MCA Students Visit for more information Home Aspirations 2020
Hello, I am using a basic circuit with a thermister, variable resister and reid switch to turn on a motor at a certain temperature. Is it at all possible to...
Hi, I'm a 3rd year EIE student. I'm planning to do graduate degree in Canada. I wanted to know which course is better Biomedical Instrumentation or Oil/Gas instrumentation? Is industrial...
I hope you must have heard about Paypal account In this thread i will explain everything about it PayPal allows members to have one Personal account and one Premier or...
Sir Do you have any project on "IDMA SIMULATION USING TURBO CODE"