Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
#include <complex>
#include <iostream>
using namespace std;
int main()
{
complex<double> test(3, 2);
cout << "Realteil: " << test.real() << " Imaginärteil: " << test.imag() << endl;
}
#include <stdio.h>
#include <stdlib.h>
struct complex{
double real;
double imag;
};
static complex* create_complex(double real, double imag){
complex* obj = (complex*)malloc(sizeof(complex));
if(obj){
obj->real = real;
obj->imag = imag;
}
return obj;
}
static void destroy_complex(complex* toDestroy){
if(toDestroy)
free(toDestroy);
}
void add(complex* res, const complex* a, const complex* b){
res->real = (a->real + b->real);
res->imag = (a->imag + b->imag);
}
int main(){
complex* a = create_complex(5,4);
complex* b = create_complex(2,3);
complex* sum = create_complex(2,3);
add(sum, a, b);
printf("Die summe aus a und b beträgt: Real: %f, Imag: %f\n", sum->real, sum->imag );
destroy_complex(a);
destroy_complex(b);
destroy_complex(sum);
}
#include <complex.h>
#include <stdio.h>
int main (void) {
double complex c = 2.1 + .3*I;
printf ("%f + %f*i\n", creal(c), cimag(c));
return 0;
}
double complex c = sqrt (7) / 3 + csqrt(-1);