Dec 7, 2013 at 8:31pm UTC
Hi there,
Why do i get this error for auto, i am reading c++ primer 5th edition with is rewritten for c++11 and i get this? thanks
1 2 3 4 5 6 7 8
#include <iostream>
int main()
{
int i = 0, &r = i;
auto a = r;
return 0;
}
error: auto changed meaning in C++11
Edit:
FIXED IT!
Just tick -std=c++11 in codeblocks by Setting Compiler and check the box
sry should have done more research before posting
Last edited on Dec 7, 2013 at 8:36pm UTC
Dec 7, 2013 at 8:39pm UTC
Interesting, I just placed the code in my IDE (VS2012 November 2012 CTP) and it worked perfectly fine.. Can we get information of what environment you are in?
edit: Good! Thanks posting your solution!
Last edited on Dec 7, 2013 at 8:40pm UTC
Dec 7, 2013 at 9:21pm UTC
I don't know what the problem was but after some research I tried this and it worked. I'm using Mingw.
And thanks for the reply :).