even after using cin.getline, it is not asking me values for inputing

This is a part of my quiz program in which i ask the user to input question and 4 options and the correct option after which in new funtion i ask the quiz. but although it is asking me "option-1", its skipping the "Ques-"

My crystal ball says that the caller of quizquestion() is doing input using the >> operator, which leaves a newline in the stream for cin.getline(stmt,100) to terminate on immediately. Try placing a cin.ignore() at the beginning of quizquestion(); I'm willing to bet that will solve the problem.

OK, now try to see what you just did as a Band-Aid rather than a true solution. The problem didn't go away, you simply hid it by extracting the remaining junk from the stream. The correct solution is not to have junk in the stream to begin with.

Be a part of the DaniWeb community

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