Where do I declare the constant variables such that they can be used in the main( ) function, and each object of my class_name?

How/where do I declare an instance of struct_name such that I can access and input the different parts in a function in my main.cpp file?

Can I declare an array with a variable in the [] that is not constant? (I don't know what [] is called) In other words, can I have arrayName[variable] where the value of [variable] changes throughout the program?

1. The only rule is that you must define it before it is used. So that can be on the line immediately before the myArray declaration, or before the class class_name, or in a different header that is #included by this header or your C file, or #included by another header that itself is #included from another header or your C file, or in your main C file before you #include this header.

2. You need additional lines of the form "struct struct_name variable_name", then if you have class_name X, you can reference myArray with X.variable_name.myArray. struct struct_name { /* contents */ }; only defines a new type struct_name, it does not declare any variables.

3. No, array dimensions must be constant. If you need variable size arrays whose size is not known until runtime (and you don't want to use a fixed size array with a count of how many items are in it, and of course an upper limit of how many items you can stuff into it), you need to use pointers and new/malloc, which sounds complicated but in reality is very easy, For example: