int main ()
{
int audience[100][2];
int i,N;
int index1=0,index2=0;
int comp_result;
cout<<"Enter the value of N : ";
cin >> N; // Enter size of the table
cout<<"Enter the base and exponent for " << N << "rows " << endl;
for(i=0;i<N;i++){
cin >> audience[i][0] >> audience[i][1]; //Enter numbers in the table
cout << endl << "Checking Function 1: Compare ecodes for 5 index pairs" << endl;
cout <<"\nEnter indices of row1 and row2 that you want to compare: ";
cin >> index1 >> index2;
if (index1 < 0 || index2 <0 || index1 >=N || index2 >=N)
continue;
int comparator(int audience[100][2],int index1,int index2);
{
int ecode[2],i;
for(i=0;i<3;i++)
{
ecode[1]=(audience[index1][0]^audience[index1][1])% 100;
ecode[2]=(audience[index2][0]^audience[index2][1])% 100;
}
if (ecode[1]==ecode[2])
comp_result ==0;
if(ecode[1]>ecode[2])
comp_result == -1;
if(ecode[1]<ecode[2])
comp_result == 1;
}
comp_result = int comparator(audience,index1,index2); //asking for primary expression before int
if(comp_result==-1)
{
cout << "ecode of index 1 is greater than ecode of index2" <<endl;}
else if(comp_result==1)
{
cout << "ecode of index 1 is less than ecode of index2" <<endl;}
else if(comp_result==0)
{
cout << "ecode of index 1 is equal to ecode of index2" <<endl;}
That's not the full error message.
I'll guess that it says something like "undefined reference" or "unresolved external".
¿have you coded a body for that function? http://www.cplusplus.com/forum/general/113904/
Also, I thought that you were using Dev-C++, not Turbo-C++ ¿?
yeah ,you are correct.
now when i look at it, it does say something like "undefined reference".
Eventually I've also discovered that in the following part if we put "return 0 or 1 or -1",this error goes----but then program execution is not right.What should i do next please guide me.
Also though I am using DEV-C++ ,title bar is showing c:\Turbo C++\Disk\TurboC3\BIN\part.cpp-Dev-C++-5.11.I think its the same problem as linking and whatever(frankly i didn't get the term) for i also have TurboC++ on my system.How do we resolve this.Please help.