Code:
#include <stdio.h>
#include <conio.h>
#include <math.h>
class complex {
public:
complex (double=0, double = 0);
friend complex exp(complex&);
~complex();
double real;
double imag;
};
complex::complex (double r, double i) : real(r), imag(i) //ovaj deo me buni. Razumem da je to konstruktor ali mi je formulacija |(double r, double i) : real(r), imag(i)| nejasna.
{
}
complex::~complex()
{
}
void main()
{
complex z(5,5);
complex t = exp(z);
printf ("%f %f\n",t.real, t.imag);
}
complex exp (complex &x)
{
return complex (exp(x.real) * cos(x.imag), exp(x.real) * sin(x.imag)); //ovaj deo takodje.
}
#include <stdio.h>
#include <conio.h>
#include <math.h>
class complex {
public:
complex (double=0, double = 0);
friend complex exp(complex&);
~complex();
double real;
double imag;
};
complex::complex (double r, double i) : real(r), imag(i) //ovaj deo me buni. Razumem da je to konstruktor ali mi je formulacija |(double r, double i) : real(r), imag(i)| nejasna.
{
}
complex::~complex()
{
}
void main()
{
complex z(5,5);
complex t = exp(z);
printf ("%f %f\n",t.real, t.imag);
}
complex exp (complex &x)
{
return complex (exp(x.real) * cos(x.imag), exp(x.real) * sin(x.imag)); //ovaj deo takodje.
}
[Ovu poruku je menjao X Files dana 20.01.2009. u 19:39 GMT+1]
to be continued...