I enter a value on the command line. That is in binary vector. But if it is not returned to the printf
message. But my problem is that it always goes into if
, regardless of whether it is binary or not.
#include <stdio.h>
#include <string.h>
#include "ex02.h"
int main(){
char binario [50][100]={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
char nome [0][10];
int contador=0;
printf("Insira um valor\n");
scanf("%s",nome[0]);
while(nome[contador]!='#include <stdio.h>
#include <string.h>
#include "ex02.h"
int main(){
char binario [50][100]={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};
char nome [0][10];
int contador=0;
printf("Insira um valor\n");
scanf("%s",nome[0]);
while(nome[contador]!='%pre%'){
if ( strcmp(nome[0], binario[contador]) !=0 )
{
printf("Base inicial invalida");
break;
}
contador++;
}
return 0;
'){
if ( strcmp(nome[0], binario[contador]) !=0 )
{
printf("Base inicial invalida");
break;
}
contador++;
}
return 0;