Hello Everbody,
I have 2 arrays called
Array 1 Array 2
Stuid stuname stuid Bookname
1 Albie 1 OOPS
2 Morkel 2 CNA
3 Jmes 1 ComputerNw
3 OOPs
2 CNA
Code:
#include<stdio.h>
main()
{
// char array1[2][1],array2[5][1];
char array1[100][100]={'ID1','srini','ID2','Albie','ID3','Kaasi'};
char array2[50][100]={'ID1','OOPS','ID2','STS','ID1','STS','ID1','CTC','ID3','MAT','ID2','MAT'};
printf("We're Begining the Comaprison Here !!\n\n");
search(array1[][],array2[][]);
}
void search(char arr1[100][100],char arr2[100][100])
{ int x = sizeof(arr1); int y = sizeof(arr2);
for(int j=0;j<y;j++)
{ int count = 0;
for(int k=0;k<x;k++)
{
if(arr1[j][0] == arr2[k][0])
{
count += 1;
}
printf("StudentID\t : BooksTanken\t");
printf("%c \t\t %d \t\n",arr1[j][0],count);
}
}
}
Here i have to find Which student how many books taken from the Library..
I wrote the Program but i'm unable to execute
Experts pls Help Me to Figure Out the Problem
And Let me Know if i'm doing something wrong in arrays!
Thanks in Advance,
Srini