lundi 1 juillet 2019

Do condition formats in if/else statements have to match in C?

I have an if statement in C that is a string comparison and an else statement that is a character comparison. For some reason, it is not working correctly. I am wondering if the condition formats have to match.

if(!strcmp(pitchtomidi[j][0], "do")) 
     {
         printf("This is the string in question %s\n", pitchtomidi[j][0]);
     }

else if(pitchtomidi[j][0][0] == '/')
     {
           printf("This is the character in question %c\n", pitchtomidi[j][0][0]);
     }

Thanks, Nakul

Aucun commentaire:

Enregistrer un commentaire