0
Basically what I want to do. It is receiving a String at the command line.Only the String entered, have to be in the binary base, so I do an if to check whether it is binary or not. My problem is in if , because regardless of the value you enter. Always enter if. - Thank you for your help!
int main(){
char binario [50][100]={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
char nome [50][100];
int contador=0;
printf("Insira um valor");
scanf("%s",nome[0]);
while(nome[contador]!='\0'){
if (nome[0] != binario[contador])
{
printf("Base inicial invalida");
break;
}
contador++;
}
return 0;
}
I reversed your edit because you changed the question problem, invalidating the answers given. If you have new questions, search the site to see if you find a similar problem, if not, ask a new question with the updated code, describing the exact problem (but be sure to have solved this step here before). I suggest a read on [Ask] for some guidelines that may help in formulating a new question.
– Bacco