I need the main string "vector" to be traversed to the delimiter '=' and copy the previous values to '=' to 'second' and values after '=' to 'third'. Sure there is a smarter way to do this, but since I'm a beginner, I'm having a hard time figuring out the correct code for this requirement.
int tam = 256;
char vetor[tam];
char segundo[tam];
char terceiro[tam];
int i = 0;
int j = 0;
fgets(vetor, tam, stdin);
for (i = 0; i < strlen(vetor); i++){
if (vetor[i] == '='){
segundo[i] = vetor[i];
} //continuar percorrendo a string e copiar valores após o delimitador '=' para o vetor "terceiro"
}
The intention is that when you enter the expression for example: 9 + 8i * 8-3i = it is possible to treat it in different vectors, in the following way: vector 1: 9 vector 2: + 8i vector 3: * 8 vector 4: -3i
If there are better ideas for calculating an expression with complex numbers, I'm open to ideas =) Ps.1: I try to make the most of the native functions of C, trying to minimize the functions of external libraries.