MNIST digit recognition - C++ version