OK, I'll try to give you some basic help.
First thing: loops
In C (or C++) a FOR loop has three parts. An initialization part, a test part, and an increment part - all of which are seperated by semicolons.
for (x = 0; x < 10; x++) {
cout << "Hi" << endl;
}
This loop will print "Hi" 10 times. We start by setting x to zero (the initialization part). Then it compares x to see if it is less than 10. If so, it executes the body of the loop once (the "cout"). After this, it executes the increment part (x++). It then retests the condition (x < 10) to see if the loop should run again.
The reason i mention all this is that your FOR loops seem to be missing a test condition and so they will run forever.
To answer one of your questions, a loop will execute once if the test condition tells it to execute only once. For example,
for (x = 0; x <=0; x++) {
// do something useful
}
^^^ This will execute exactly once.
I hope this helps.
Dave