Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi Translations

Status
Not open for further replies.

tvidigal

Programmer
Sep 8, 2003
19
0
0
PT
Hi All!
I don't know if this thread is the most suitable for this post, if not I apologise in advance!

I'm translating some stuff from delphi and I have this peace of code

type FiltProc = function(V: Single): Single of object;

and later inside a class I have this declaration:

Fil: FiltProc ;

How can I translate this to C++?

Another quick thingy:
I have a record which i translated it to:
typedef struct TTC
{
float Re, Im;
} TC;

but then I have constant declaration for this record which I can't translate it to C++. How is it made?

(in delphi)
BP: Array[0..29] of TC = (
(Re:-1.00000000000e+00; Im:0.00000000000e+00), (Re:-1.10160133059e+00; Im:6.36009824757e-01),
(Re:-1.32267579991e+00; Im:0.00000000000e+00), (Re:-1.04740916101e+00; Im:9.99264436281e-01), ..... );

Thanks in advance!
All the Best




Tiago Vidigal
 
The 2nd part only:
Code:
typedef struct TTC
{
 double Re, Im; // Better use double instead of float
} TC;
/* or simpler:
struct TC { double Re, Im; };
*/
TC Array[30] = // float precision - only 6 digits...
{
  { -1.00000000000e+00, 0.00000000000e+00 }, 
  { -1.10160133059e+00, 6.36009824757e-01 },
  { -1.32267579991e+00, 0.00000000000e+00 },
  { -1.04740916101e+00, 9.99264436281e-01 },
  .....
);
It's array of structures definition, not a constant declaration...

See also STL <complex> header: it contains full complex numbers class declaration...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top