Do you know what an array is? A vector is like an array, but it starts off with size 0 and you can add as many elements to it as you want. It should take you no more than 30 minutes to learn how to use a vector. The notation can look a little scary, but it's really simple. One beginning C++ book actually starts off teaching about vectors instead of arrays.
I will also investigate vectors, though I do not really have an understanding of the principle you mentioned.
If you learn about vectors, you should also check out maps. Have you ever wanted to use an array with strings as the index values? Maybe like this:
With a map you can do that. Vectors and maps are known as STL 'containers', and the C++ language has all the facilities to use them. Here are some examples:
myArray["Betty"] = "245-0012";
myArray["Mike"] = "312-6789";
using namespace std;
//Declare a vector(#include <vector>). The type indicated
//between the <> is the type you are allowed to store in
//the vector. It can be a user defined class as well.
int n1 = 10;
int n2 = 20;
int n3 = 30;
//Add int's to the vector using the push_back() function.
//push_back() adds elements to the end of the vector:
//Display the int's in the vector:
for(int i = 0; i < myNums.size(); ++i)
//Erase an element in the vector:
for(int j = 0; j < myNums.size(); ++j)
using namespace std;
//Declare a map(#include <map>).
//The first type between the <> is the type of the index
//value, and the second type is the type you want to store
//at that index value.
map<string, string> PhoneBook;
PhoneBook["Betty"] = "245-0012";
PhoneBook["Mike"] = "312-6789";
//Declare a different map:
map<string, int> myHeadings;
myHeadings["plane1"] = 30;
myHeadings["plane2"] = 45;
//Get an "iterator"(which is like a pointer) to the
//beginning of the map. You indicate the type of the map
//you are dealing with and then use the word "iterator":
map<string, int>::iterator i = myHeadings.begin();
//Use the pointer to move along the map and display all
//the elements. There's a little twist though: map's
//actually store the index and the element together in a
//struct called a 'pair'. That means the pointer you have is
//actually pointing to a pair struct. In a pair, the
//index is stored in a member variable called 'first' and
//the element is stored in a member variable called 'second':
for(; i != myHeadings.end(); ++i)
cout<<"index: "<<i->first<<" element: "<<i->second<<endl;
If you want to do it in Win32, you're going to need to start reading a 1500 page book called Windows Programming(Petzold).
Should I be trying to write this in a DOS window, or WIN32 application?