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.

Is there a way to compile C++ to C Code?

The C++ FAQ has a list of possibilities: Is it possible to convert C++ to C?. In short, it says that you can’t expect this to give you particularly readable code. Think of the complexities involved; multiple inheritance, virtual-function resolution, templates, operator overloading, etc., etc. There’s no clean succinct way of expressing these concepts in pure C. If … Read more

“cannot be used as a function error”

You are using growthRate both as a variable name and a function name. The variable hides the function, and then you are trying to use the variable as if it was the function – that is not valid. Rename the local variable.

Is C++ Array passed by reference or by pointer?

At worst, your lecturer is wrong. At best, he was simplifying terminology, and confusing you in the process. This is reasonably commonplace in software education, unfortunately. The truth is, many books get this wrong as well; the array is not “passed” at all, either “by pointer” or “by reference”. In fact, because arrays cannot be passed by … Read more

REGSVR32: the module “xxxxx.dll” failed to load … dependent assembly could not be found

This is almost certainly due to a missing dependency. Use a tool like Dependency Walker to find the required dependencies of the DLL. Or, if the DLL is supplied by a third party, read their documentation which should specify the required dependencies. Note that Microsoft.VC90.ATL indicates version 9 of MSVC which is VS2008. So you would need to install … Read more

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