I am new to Obj-C, and trying to do the following self-declared C++ operations within header files in Obj-C:
myheader.h
....
struct CINT
{
int re, im;
CINT (void) : re(0), im(0) {}
CINT (const int data) : re (data), im (0) {}
CINT (const int data_re, const int data_im) : re (data_re), im (data_im) {}
CINT (const CINT& data) : re(data.re), im(data.im) {}
CINT& operator = (const int Op2) { re = Op2; im = 0; return *this; }
CINT& operator += (const CINT& Op2) { re += Op2.re; im += Op2.im; return *this; }
CINT& operator -= (const CINT& Op2) { re -= Op2.re; im -= Op2.im; return *this; }
....
CINT operator + (const CINT& Op2) const { return CINT (re + Op2.re, im + Op2.im); }
CINT operator - (const CINT& Op2) const { return CINT (re - Op2.re, im - Op2.im); }
CINT operator * (const CINT& Op2) const { return CINT (re*Op2.re - im*Op2.im, re*Op2.im + im*Op2.re); }
....
Would it be possible to keep such declarations and operations in obj-C? or need to re-write the whole thing? If so, how? Thanks!