fixed #2502
Merge pull request #2505 from khalednasr/neuralnets_cpp_examples

fixed #2502