dimanche 28 février 2016

If statement inside a case statement c seems to ignore condition and just do else

I am using cmd to launch my program and it reads through arguments typed in cmd and the if statement doesnt seem to work it just goes to else and executes. its supposed to read if the 4th argument typed in is = (in this case) "something" then execute the code.. anyone has any idea ?

int main(int inputn, char* inputs) 
{ 
switch (inputn)
{
case 6:
if(input[4] == "something") 
{
//code
break;
}
else        
{
//code   
break;
}
.
.
.
default:

//code break; } }

Aucun commentaire:

Enregistrer un commentaire