c++ array – expression must have a constant value

When creating an array like that, its size must be constant. If you want a dynamically sized array, you need to allocate memory for it on the heap and you’ll also need to free it with delete when you’re done: If you want a fixed size, then they must be declared const: Also, doesn’t even provide a … Read more

Comparison with string literal results in unspecified behaviour?

In C++ == only implemented internally for primitive types and array is not a primitive type, so comparing char[100] and string literal will only compare them as 2 char* or better to say as 2 pointers and since this 2 pointers can’t be equal then items[n] == “ae” can never be true, instead of this you should either use std::string to hold string as: or … Read more

I’m getting an error “invalid use of incomplete type ‘class map’

Your first usage of Map is inside a function in the combat class. That happens before Map is defined, hence the error. A forward declaration only says that a particular class will be defined later, so it’s ok to reference it or have pointers to objects, etc. However a forward declaration does not say what members a class has, so as … Read more

warning: control may reach end of non-void function

Your function returns a bool but there’s a potential code path (e.g. z.count is 0) where it may reach the end of the function and return nothing. Hence, the warning issued by the compiler. Add return false; (or return true; but false seems appropriate with your current logic) at the end of your function. As pointed out by others, your else part is also wrong. I’d rewrite it … Read more

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