How to make a random data generator in c++?

Of your own? How "random" do you want the output? There are plenty of texts out there that can explain some of the more common ways. Here is a great tutorial compliments of the US government and my tax dollars: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html

It is one of the best treatises on the subject I have found.

If you don't want to programm your own random number generator but instead want to use something done, C++11 have a complete random number library defined in <random>. There, the standard library defines facilities for generating (pseudo-)random numbers with different distributions. I consider this library one of the most complete and advanced random number generator that exist. So, take a look to it.

Google "C++11 random number" to find tutorials.