When it works, it's because the calculation was done by the compiler itself (and included in the binary as if you wrote it out)
printf("8
");
When it doesn't work, is because the pow
function is included in the math library and the math library isn't linked with your binary by default.
To get the math library to be linked, if your compiler is gcc, use
gcc ... -lm ...
With other compilers, should be the same :)
but read the documentation
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…