dnoy99
November 11th, 2001, 08:10 PM
Im trying to compare the information of a char in a struct to the information to another char in a different struct.
for(int l=0; l<sizedaily; l++)//the size of pArray
{
for(int u=0; u<size; u++)//size of drivername
{
for(int f=0; f<4; f++)//size of the ID field
{
if(strcmp(&drivername[u].ID[f],&pArray[l]->ID[f])==0)
{
c++;
}
cout<<c<<endl;
}
}
c=0;
}
The c represents how many times the data match up. Im having a hard time trying to figure this out and i would appreciate it if someone could help me out. Im trying to compare the data and see which ones match up. pArray is a pointer too. Thanks
for(int l=0; l<sizedaily; l++)//the size of pArray
{
for(int u=0; u<size; u++)//size of drivername
{
for(int f=0; f<4; f++)//size of the ID field
{
if(strcmp(&drivername[u].ID[f],&pArray[l]->ID[f])==0)
{
c++;
}
cout<<c<<endl;
}
}
c=0;
}
The c represents how many times the data match up. Im having a hard time trying to figure this out and i would appreciate it if someone could help me out. Im trying to compare the data and see which ones match up. pArray is a pointer too. Thanks