SDL2.DLL missing

I’m following this tutorial to setup the SDL template but when I try and run the program I get the following error. I have gone over the tutorial several times but cannot see what mistake I am making. I copied the SDL2.DLL into the Release Directory and then ran it and I got a different error. but I imagine that I … Read more

Deep copy vs Shallow Copy

Possible Duplicate:What is the difference between a deep copy and a shallow copy? What is the difference between deep and shallow copy. What type of a copy does a copy constructor do?

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

Separating class code into a header and cpp file

The class declaration goes into the header file. It is important that you add the #ifndef  include guards. Most compilers now also support #pragma once. Also I have omitted the private, by default C++ class members are private. and the implementation goes in the CPP file:

Does the ‘mutable’ keyword have any purpose other than allowing the variable to be modified by a const function?

It allows the differentiation of bitwise const and logical const. Logical const is when an object doesn’t change in a way that is visible through the public interface, like your locking example. Another example would be a class that computes a value the first time it is requested, and caches the result. Since c++11 mutable can be … Read more

What exactly is std::atomic?

Each instantiation and full specialization of std::atomic<> represents a type that different threads can simultaneously operate on (their instances), without raising undefined behavior: Objects of atomic types are the only C++ objects that are free from data races; that is, if one thread writes to an atomic object while another thread reads from it, the behavior is … Read more

invalid new-expression of abstract class type error

You aren’t actually overriding the sort function, so MergeSort is still an abstract class: These sorts have different signatures, so they are different functions. To solve this, you either need to change your MergeSort::sort method to not take in a low and high argument, or to add a low and high argument to your other sort methods.

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