Hello, I am a beginner at C++ and need some help with arrays..
- I need to create a function that returns a random number from a sequence of 4 #s.
- Then I have to loop it 1000x and print the frequency of those 4 #s.
So far I have:
const int n=4, ntimes=1000;
int freq[n]={0};
short int seq[]={11,35,99,132};
and I understand I need to use:
rand(freq, n, ntimes);
and to output:
cout<<rndseq<<" occured "<<freq<<" times"<<endl;
Obviously, I havent had much time to work on it yet. I tried reading up on arrays but I did not find much on this specifically..
I just need someone to help me start off on the right foot. I'm not expecting anyone to fully write it for me. Just some pointers please. Much appreciated.