0

I have header file where I declare vector od structs:

#include <d3d10.h>
#include <d3dx10.h>
#include <vector>
#include <fstream>
#include <istream> 
#include <sstream>

using namespace std;


struct bone{
    string name;
    D3DXMATRIX TransformMatrix;
};

class animator
{
public:
    animator();
    ~animator();

    vector <bone> Skeletone;

    void loadXfile(string Filename);
};

Everything looks fine but when I try to use push_back() in code and debug, the data in Skeletone are unable to read. This problem doesn't occur when I use this same type of vector but declared locally in function (tempvecbone).

if (checkChar == ';'){
    tempvecbone.push_back(tempBone);
    Skeletone.push_back(tempBone);
    while (checkChar != '}')checkChar = fileIn.get();
}

Link to screen from debugger

Anyone knew what's going on?

1 Answers1

0

If anyone else has this problem, it was caused by "Maximize Speed (/O2)" Optimization in Visual Studio project settings. It can be changed in Project Properties -> C/C++ -> Optimization (Now I set to Disabled).