compilation problems

i got compilation problems but i donw know whats wrong??could you help me? plz!

adChannel::setRs()
71 {
72 double tmp,add,div;
73
74 tmp=0;
75 for(vector<adPoint>::const_iterator iterator = getPoints().begin(); iterator != getPoints().end(); iterator++)

76 {
77 if (iterator == getPoints().begin()) tmp= pow(*iterator,2);
78 else
79 {
80 add=pow(*iterator,2);
81 add=add+tmp;
82 tmp=add;
83 }
84 }
85 div=add/m_size;
86 m_rms=sqrt(div);
87 }

compilers errors:

...\adChannel.cpp In member function `void adChannel::setRs()':
77 ...\adChannel.cpp no matching function for call to `pow(const adPoint&, int)'
note C:\Dev-Cpp\include\math.h:150 candidates are: double pow(double, double)
note C:\Dev-Cpp\include\math.h:150 long double std::pow(long double, int)
note C:\Dev-Cpp\include\math.h:150 float std::pow(float, int)
note C:\Dev-Cpp\include\math.h:150 double std::pow(double, int)
note C:\Dev-Cpp\include\math.h:150 long double std::pow(long double, long double)
note C:\Dev-Cpp\include\math.h:150 float std::pow(float, float)
80 ...adChannel.cpp no matching function for call to `pow(const adPoint&, int)'

... same notes as before..

D:\projects\A&D\Makefile.win [Build Error] [adChannel.o] Error 1 .

i have another question... should i use the pointer "this"?? , like this..???


void adChannel::setRs()
{
double tmp,add,div;

tmp=0;
for(vector<adPoint>::const_iterator iterator = this->getPoints().begin(); iterator != this->getPoints().end(); iterator++)
{
if (iterator == this->getPoints().begin()) tmp= pow(*iterator,2);
else
{
add=pow(*iterator,2);
add=add+tmp;
tmp=add;
}
}
div=add/m_size;
m_rms=sqrt(div);
}

THXS!!
I fix it!! thxs!! everyone!


i replace "(*iterator,2);" for ((*iterator).getReal(),2);

Take care!
Topic archived. No new replies allowed.