Question: I used the matlab neural network to train on some data but I want to run this neural network in c++ program,how to do that?

Answer: 
You can use ML to generate your feature set (input layer) and then use an open source C++ NN implementation to do training/classification. (E.g., <http://takinginitiative.net/2008/04/23/basic-neural-network-tutorial-c-implementation-and-source-code/>) If you want to use ML to train and C++ to classify it shouldn't be too difficult to write some additional code to write out the trained network in a way that can be read in by the C++ classifier.
You can use the Matlab Compiler that generates code you can embed in your C++ application