What difference between rand() and random() functions?

后端 未结 7 1314
抹茶落季
抹茶落季 2020-12-05 07:58

Once, my teacher taught me to use randomize() and random() function for generating pseudorandom numbers in C++ Builder. Now I prefer working in VS

7条回答
  •  一生所求
    2020-12-05 08:33

    srand() is the C Standard library implementation for seeding the (pseudo) random number generator. rand() is the (pseudo) random number generator in the C Standard Library.

    C++ has implemented a newer (pseudo) random number generator in the header file, which has a variety of different engines to use: http://en.cppreference.com/w/cpp/numeric/random

提交回复
热议问题