expected constructor, destructor, or type conversion before ‘(’ token

The first constructor in the header should not end with a semicolon. #include <string> is missing in the header. string is not qualified with std:: in the .cpp file. Those are all simple syntax errors. More importantly: you are not using references, when you should. Also the way you use the ifstream is broken. I suggest learning C++ before trying to use it. … Read more

C++ Fractions Class

You may want to start with just the first part, create the class with two constructors, one if they give the two numbers, and one that defaults to 1. Then, write the four functions, the assignment is nice enough to give you the equations. If a denominator is ever equal to zero then I would … Read more

std::wstring VS std::string

I am not able to understand the differences between std::string and std::wstring. I know wstring supports wide characters such as Unicode characters. I have got the following questions: When should I use std::wstring over std::string? Can std::string hold the entire ASCII character set, including the special characters? Is std::wstring supported by all popular C++ compilers? … Read more

Error “system” is ambiguous?

You need to #include <cstdlib> Source: http://en.cppreference.com/w/cpp/utility/program/system Also, try to avoid system, it’s dangerous. To pause the program when it’s finished, put a breakpoint on the } at the end of main. There isn’t a standard way to clear the screen unfortunately. For future reference, the red squiggles are intellisense errors, which are shown by a different front-end than the one that … Read more

QltAW.png

Base class constructors are automatically called for you if they have no argument. If you want to call a superclass constructor with an argument, you must use the subclass’s constructor initialization list. Unlike Java, C++ supports multiple inheritance (for better or worse), so the base class must be referred to by name, rather than “super()”. … Read more

extra qualification error in C++

This is because you have the following code: This is not valid C++ but Visual Studio seems to accept it. You need to change it to the following code to be able to compile it with a standard compliant compiler (gcc is more compliant to the standard on this point). The error come from the … Read more

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