I am new to C programming. I am trying to compare a two strings. I get the error: Multiple markers at this line. passing argument 1 of 'strcmp' makes pointer from integer without a cast. passing argument 2 of 'strcmp' makes pointer from integer without a cast
char names[SIZE][LENGTH];
char srch_name[LENGTH];
if(strcmp(names[g][LENGTH], srch_name[LENGTH]) == 1)
if(strcmp(names[g], srch_name) == 1)will eliminate the warning, but note that if strings are equal, the return value is 0. - Ken Y-Nstrcmparecharelements from arrays. They have an integer type. The arguments should have typechar *. Further, you are usingLENGTHas an index into these arrays, which is out of bounds. You really need to read a tutorial on C arrays and pointers before trying to code them. The trial-and-error approach simply will not work. - Tom Karzes