hi
i just started programming so im very new to all this, i am writing a code and i am comparing a string in a struct to a string. one of them as you can tell is an array of strings, im not really sure if im breaking any rules by doing that.. but i get the error
"Warning: passing arg 1 of 'strcmp' makes pointer from integer without a cast"
i actually get 2 of those identically which point to the same line. can anyone help me out and show me what im doing wrong
for (j=0; j<numrecords; j++) {
fscanf(fin, "%s %s", &firstname[j], &lastname[j]);
for (a=0; a<numemp; a++) {
//THIS IS WHERE ITS MESSING UP
int b = strcmp(firstname[j], emp[a].last);
int c = strcmp(lastname[j], emp[a].first);
if (b == 0 && c == 0)
empid = a;
else
continue;
}
fscanf(fin, "%d%d%d%d", &hrin, &minin, &hrout, &minout);
// Calculate the time worked and credit the appropriate employee.
hrsworked[empid] += times(hrin, minin, hrout, minout);
printf("%s\n", firstname[empid]);
}
thanks
-Grant