+ 1
Fill a vector with random numbers 1-9?
Ok, So I just asked a similar question, but I thought I'd make it easier to understand. I want a function that will fill a vector with each digit 1-9. Each digit is only to be used once. I know how to generate random numbers, but I every attempt has somehow generated strange numbers (like -27263118 or 33783728) or it just pushed a few numbers the vector. If you need me to show what I've tried, I'll have to re-write something.
3 Respostas
+ 1
Anna This is perfect. Would you mind adding comments explaining the code?
+ 1
Daniel Cooper Thank you. Done ☺️