Hi.. Can somebody help me with my project in c++?
My project proposal that I had submitted is about Question and answer program. It is just like a game. I formulated many questions and their desired answer. The problem is, I want to randomize the question so that it will be much better. I don't know yet how to use the function named rand(); using it with the strings. Can anybody give me some examples of your source code?? Thank you for your consideration. :)

Put the questions is an array of strings then you can use rand() as an index into that array. Something like this

char *questions[] = {"one","two","three","four","five"};
srand((unsigned int)time(0));

do
{
   int index = rand() % 5; // 
   cout << questions[index];
} while(true);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.