I am trying to solve euler problem 184 for 2 weeks now. I was fisrt started to develop the code on DevC++, it was fine no errors I got. Then I switched it to Code::Blocks due to some linker messy issues of DevC++. Code:Blocks was fine but in this code below(which I was perfectly compiled in DevC++) it throws some errors like this:
C:\Users\Samsung\Desktop\C projects\Euler\Euler184\Eulrt_Test_V5\Euler184_Test_V5.cpp|45|error: call of overloaded `pow(int, int)' is ambiguous|
I will give the specific part of the code below. What do you think the problem might be? Thanks.
C's pow is in the global scope, whereas C++'s std::pow isn't. This is one of the reasons why usingnamespace std; is bad - you make it impossible for the compiler to know which one you want.
Don't write usingnamespace std; and just use std::pow.
I made the change and the error is gone now. But new error came up: C:\Users\Samsung\Desktop\C projects\Euler\Euler184\Eulrt_Test_V5\Euler184_Test_V5.cpp|52|error: expected primary-expression before '{' token|