Hi all, I am VERY NEW in C++ and programming. I just wanna print w and i, such that when w is equal to 16, i increases by 1 and w restarts from 0 until w reaches 1024. But the result doesn't come as I expected. Pls. guide me. Here is the code I have written.

void count(int, int);
int calcW(int *);
int main()
{
int w=16, i=0;
count(w, i);
return 0;
}

void count(int i, int i)
{
int *wPtr;
wPtr = &w;
while (i<=2048)
{
for (int n=0; n<=*wPtr; n++)
{
cout<<"value of i = "<<i<<endl;
cout<<"value of n = "<<n<<endl;
if (n==*wPtr)
{
calcW(wPtr);
cout<<"value of *wPtr in 2nd function"<<*wPtr<<endl;
cout<<"reset w to 0 here"<<endl;
if (i<=7){
++i;
count(w, i);
}
}
}
}
}

int calcW(int *wP)
{
return *wP = (*wP) * 2;

}