Loading a vector of vectors with random numbers

closed account (9ST04iN6)
I need to load a vector of vectors with 0's and 1's randomly and I'm unsure how to calculate a random number generator. This is an intro class so the most simple answer would be the best. My class has touched upon the "rand" function a few times if that helps.
int r = rand() % 2; will produce a 0 or 1. Be sure to #include <cstdlib> . Try to combine that with the information already shared with you in the other thread to come up with a solution.
Last edited on
closed account (9ST04iN6)
Yup I got it. Thank you!
Have you written any code to try to solve your assignment yourself? Post it here.

Getting help and hints is fine, if you show you've made an effort. We won't do your homework for you.
Topic archived. No new replies allowed.