I want to write code that takes a sequence of complex numbers and searches for a number in it. But I don't know how to write a function to form the sequence. This is what I've tried so far:
class complex {
private:
int real;
int image;
int n;
int *a;
public:
complex(float l, float k) : real(l), image(k) {}
float set(float l, float k)
{
cout << "enter size of array: ";
cin >> n;
for (int i = 0; i < n; i++)
{
cout << "enter real part: ";
cin >> l;
cout << "enter image part: ";
cin >> k;
*(a+i) = complex(l, k);
}
}
};