Log of x to base n

http://ide.codingblocks.com/#/s/16706
https://hack.codingblocks.com/contests/c/474/189

how to implement number X and base N in the program?

#include
#include
using namespace std;
int main()
{
int n = 2;
cout<<log10(1000) / log10(n);
}
Base n of 1000

If you wanted the implementation of log func, i implemented it using binary search technique.
Here’s my C++ code.
#include
using namespace std;

long long power(long long X,long long N)
{
if(N==0)
return 1;
if(N%2==0)
return power(XX,N/2);
return X
power(X,N-1);
}
long long logbaseN(int X,int N,long long start,long long end)
{
if(start>end)
return -1;
long long mid=(start+end)/2;
long long r=power(N,mid/1000000000);
if(r==X)
return mid;
else if(r<X)
return logbaseN(X,N,mid+1,end);
else
return logbaseN(X,N,start,mid-1);
}
int main() {
// your code goes here
int X,N;
cin>>X>>N;
long long ans=logbaseN(X,N,0,18000000000);
cout<<ans/1000000000;
return 0;
}

But you haven’t declared XX and Xpower in your long long power(long long X,long long N) function.
So won’t it give error?

copy paste issue
it was actually XX and Xpower(X,N-1)