Penso che dovresti scrivere così
codice:
if( ! strcmp( codice, cod) && ! strcmp( materia, mat) )