It's a task from my college and im hard stuck on this one. It's the beginning of a Mandelbrot programm with different greyscalings but I get lost with structs and typedef really quick. The last part here were I used the "->" was something we had to code but Im still not sure how this works exactly when all have the same destination.
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
/** complex numbers have a real and an imaginary part */
typedef struct {
double real;
double imag;
} complex_t;
/** constant 0 */
const complex_t complex_0 = {0,0};
/** constant 1 */
const complex_t complex_1 = {1,0};
/** constant i (often called j in electrical engineering) */
const complex_t complex_j = {0,1};
/**
* Adds two complex numbers
* @param c0 pointer to the complex number storing the result
* @param c1 pointer to first number
* @param c2 pointer to second number
*/
void complex_add( complex_t *c0, complex_t *c1, complex_t *c2 ) {
c0->imag = c1->imag + c2->imag;
c0->real = c1->real + c2->real;
}