Hey! I need help .. Im stuck with my program im working with.. It's designed to create questions and cout questions in random order... I dont know how to use random with questions instead of numbers.. Help please!
#ifndef Crandom_h_
#define Crandom_H_
#include <string>
class CRandom
{
public:
// grundstruktur för ge ut random.
int randomize(int min, int max);
void seed();
private:
};
#endif
--------------------------------
int main()
{
vector<CÄmne>Ämnet;
vector<CFrågor>Questvector;
queue<CFrågor>GQuest;
vector<CFrågor>VGQuest;
vector<CFrågor>MVGQuest;
Do you have your questions in something like a vector list or a list of some form? Can you get the count of that list? Can you randomize the a number in the range of 0 to max of the list? can I extract something from that list at the random position? Last time I looked vector<> and list<> both had things I could do like this.
I don't know what language it is but I am assuming CFragor is the Question class, which is put on the vector<CFragor> myFragors; // list of questions .