On 2016-11-03 14:09, Paul wrote:
> On my home PC, I use C++11 with gnu and codeblocks.
> The code below generates a garbage value which is what I would expect.
>
> #include <vector>
> #include <iostream>
> int TenPower(std::vector<int> n) {
> int r;
> return r;
> }
> int main()
> {
> std::cout << TenPower({});
> // Output is 4199040 -- not surprising.
> }
>
>
> However, when I use
codefights.com which enables g++ 5.0 c++ 14, r = 0 is
> returned. However, this website doesn't give users ready access to the
> main statement or the #include statements.
>
> It seems (to me) like the TenPower function returns 0 in C++14 and a garbage
> value in C++11. Is this correct? If so, what is the precise change that
> makes this difference?
>