pow function

hello. i have this program

void p2 (int & n, int & x)
{

x=0;
pow(x,2)=0;

while(pow(x,2)<n)
{
pow(x,2)=pow(x,2)+2*x+1;

x=x+1;
}
}


but it shows me error in pow. how can help me to correct this program?
1
2
3
4
5
6
7
8
9
10
11
void p2 (int &n, int & x)
{
    x = 0;
    double powX = 0;

    while(powX < n)
    {
        powX = pow(x, 2) + 2*x + 1;
        x = x+1;
    }
}
What's the error?
Topic archived. No new replies allowed.