I´m having a problem in the result of the following code. This is the main function that cant make any switch.
If the size of the vetor of char its not to many, like the 1 image, the result its ok but if they have more char the result buggs(2 image).
What im doing wrong??
Thanks for your help.
void main()
{
char str[BUFFER];
int i, tamanho, tabuleiro[BUFFER];
scanf("%s", str);
tamanho=strlen(str);
for(i=0;i<tamanho;i++){
if(str[i]=='0'){
tabuleiro[i]=0;
}else{
tabuleiro[i]=1;
}
}
MostraLamberta(tabuleiro, tamanho);
}
int MostraLamberta(int* tabuleiro,int tamanho){
int i;
char novostr[BUFFER];
for(i=0;i<tamanho;i++){
if(tabuleiro[i]==0){
novostr[i]='O';
}else{
novostr[i]='X';
}
}
printf("%s", novostr);
}