Quantcast
Channel: User koan - Stack Overflow
Viewing all articles
Browse latest Browse all 40

Comment by koan on Properly seeding rand_r(int *val) method

$
0
0
@user1742385, rand_r modifies the parameter and you are passing it a temporary variable that will go out of scope as soon as the rand_r function is entered. You should create a variable for your seed and use that as the argument

Viewing all articles
Browse latest Browse all 40

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>