You are in the right track.But try to see the code in this way for ease of visualization...
for(int i = 0; i < n-1; i++)
{
x=(int)pow(2,i);
for(int j = 1; j <= x; j++)
cout << j << endl;
} You can see that here too x and i vary as x = 2 power i just like in your code.
So as you can see the complexity turns out to be
==> Summation where i ranges from 0 to n-2( Summation where j ranges from 1 to 2 power i( 1 ))
==> Summation where i ranges from 0 to n-2( 2 power i )
==> (2 power 0) + (2 power 1) + (2 power 2) + (2 power 3) + ...... + (2 power (n-2))
And you can see that (2 power 0) + (2 power 1) = (2 power 2) - 1;
(2 power 0) + (2 power 1) + (2 power 2) = (2 power 3) - 1 and so on ... Therefore above problem comes to
==> (2 power (n-1)) - 1
And thats your complexity or Big-Oh.Hope you understand...Cannot put it in any better way :)