Declaring variables below the script rather than at the beginning?

Cheers to my first ever post on the first ever programming forum I've ever been in!

Anyways, for the context, I'm writing a quiz game in c++ along with my friend. It's text based and pretty simple.

Do note that I just recently started learning about c++ so my technical knowledge is nil and I might not understand more advanced stuff but I get the gist.

So I have say, 50 questions in the script right now. That means that there will be 50 question holding variables, 50 x 5 more variables for the options and 50 variables holding the answer.

Variables are important because I want the order of questions to be completely random. I will post the code after it's done.

So is it possible to declare the variables below all of the script? I know that you can put functions below the main function so I was thinking maybe there was a way to declare global variables via functions?

That would be helpful because otherwise you would have to scroll over some 350 lines of variables just to get to the main function!

So assuming that's not possible, can somebody explain to me how I can use modules in c++ for this purpose? I have never done anything related to importing in c++ so if it comes to this, explain it like you would to a 5 year old.

No, declaring variables at the bottom of the script is not useful and is confusing at best.

There are a couple of things going on here. First, C++ is executed in roughly top down order, so you will need to declare things before you use them, not after. I realize that in functional languages, declarations might not matter where you place them, but C++ is not entirely functional, and more imperative in this respect. Second, you might be asking where to place things like structures or class declarations, and not just variables (which might be structure or class type). The truth is, these are normally placed in their own files, which is something that you can learn later. Maybe from this.

If you are just talking about variables, then in C++, it is considered good practice to declare variables near their first use.