Im trying to do a nested loops to iterate through the characters that I pass through into argv. Lets say I pass multiple args into the command line like 10 30 50 60 I want to do something like this:
void isValid(int argc, char *argv[])
{
for (int i = 2; i < argc; i++)
{
int len = strlen(argv[i]);
for (int j = 0; j < len; j ++)
{
if (strcmp(argv[i][0], "-") == 0)
{
printf("- is the first character in index in the first argument");
}
}
}
}
Im getting a warning however that passing argument 1 of ‘strcmp’ makes pointer from integer without a cast. So is this the correct way to iterate through using nested loop? is there a different method that is correct? What am I doing wrong?