0
I have a bond for
* what account of 1 to 8 and keeps in a array calling for str
, but I would like that when the variable str
to reach 8 is stored the value of str[i]
in the array str_line[b]
;
Example:
- The noose
for
initiating - It keeps at each cycle the value in
str[i]
- When i=8 stores everything that has been accumulated so far on
str[i]
and keeps instr_line[b]
- Increases the
b
- Zera the
i
and starts all over again - When the
b
is in 5, for the loopfor
The program would do this during its execution:
str[1] = 1
str[2] = 11
str[3] = 111
str[4] = 1111
str[5] = 11111
str[6] = 111111
str[7] = 1111111
str[8] = 11111111
Guarda tudo que estiver em `str[8]` em `str_linha[1]`;
Incrementa o `b*`
E repete isso até o laço FOR fizer isso 5 vezes.
I’m having trouble transferring the value of str[8]
for str_line[1]
, how can I do?
My code so far:
char str[9];
char str_line[6];
int i;
int b;
for(i = 0; i < 8; i++)
{
str[i] = '0' + i;
Serial.println(str);
if(i = 8)
{
//Aqui guardaria o valor em str_line.
//Zera o ponteiro e começa a contagem do FOR desde o inicio
i = 0;
elseif(b = 5)
{
//Para o laço FOR
}
}
}
Did the answer solve your problem? Do you think you can accept it? If you don’t know how you do it, check out [tour]. This would help a lot to indicate that the solution was useful to you and to give an indication that there was a satisfactory solution. You can also vote on any question or answer you find useful on the entire site.
– Maniero