Compiling C++11 with g++

Flags (or compiler options) are nothing but ordinary command line arguments passed to the compiler executable. Assuming you are invoking g++ from the command line (terminal): $ g++ -std=c++11 your_file.cpp -o your_program or $ g++ -std=c++0x your_file.cpp -o your_program if the above doesn’t work.

What is the printf format specifier for bool?

There is no format specifier for bool types. However, since any integral type shorter than int is promoted to int when passed down to printf()‘s variadic arguments, you can use %d: But why not: or, better: or, even better: instead?

How can I create objects while adding them into a vector?

To answer the first part of your question, you must create an object of type Player before you can use it. When you say push_back(Player), it means “add the Player class to the vector”, not “add an object of type Player to the vector” (which is what you meant). You can create the object on the stack like … Read more

where is the official c++ documentation

The official C++ “documentation” is the C++ standard, ISO/IEC 14882:2014(E). There is information at ISOCPP how to obtain the document. I wouldn’t necessarily consider the standard good documentation but it does specify the behavior of the standard language and library constructs. There isn’t any other official document on C++ describing the entire language. There are good derivative works making … Read more

Inheriting constructors

If your compiler supports C++11 standard, there is a constructor inheritance using using (pun intended). For more see Wikipedia C++11 article. You write: This is all or nothing – you cannot inherit only some constructors, if you write this, you inherit all of them. To inherit only selected ones you need to write the individual constructors manually and … Read more

“&” meaning after variable type

It means you’re passing the variable by reference. In fact, in a declaration of a type, it means reference, just like: declares a reference to x, called y.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)