Posts

Showing posts from April, 2022

C++:thinking: Demo

Image
 Demonstration So for my demonstration I made a small quiz application using C++ in this blog I will explain how I created this small application.       Code So in this section ill go through segments of the code and explain what is going on in that section.     So for this section of code I create two String vectors one called questions and the other called answers. Vectors are very similar to arrays where they use contiguous storage locations for their elements. But a major difference between vectors and arrays are that vectors can grow dynamically compared to an array.   This section of code is used to fill the vectors I start off by creating a String for question which is named quest and answers which is ans. The ifstream is an input stream that is used to read from the Questions.txt where I have the questions to the quiz written. After reading the file all the lines are run through a loop where each question in recording and inserted into the...