Quote Originally Posted by Peter Swinkels View Post
I see people initializing huge arrays directly in code. Wouldn't it be much easier to just store all that text in a resource and load it from there?
Is it much easier?

You write the text in a resource.
You write the text in the Form.

The text from the resource is included in the executable.
The strings from the form are included in the executable.

You write some code to load the array from the resource.
The executable loads the array, no extra code to be written. The possibility exists that this could be done in a fairly efficient way, I don't know.

But the primary reason, for me, in this thread is that this is simply an example. The code was provided as text within the post. No need to zip up and attach a project. If you used a resource, then you would have had to create a project, zip up the sources and post the project and have the user reverse the process.
For a simple example like this, that seems like unnecessary extra work.

Personally, I wouldn't use a resource. I would use a file that the program would read so that I could have any number of quizzes to choose from and could always add more without having to recompile the executable.

Also, for this particular type of quiz, I would probably have included specific State based wrong answers of large or well know cities within the sate which might increase the chance for a wrong selection, e.g. include Los Angeles and San Fransisco for California, and Philadelphia for Pennsylvania or Seattle for Washington, or Hilo for Hawaii or New Orleans for Louisiana, or Saint Louis for Missouri, or Rapid City for South Dakota, etc...
Including only cities that are capitals of other states aids the process of elimination.