Thanks!, but I am still getting a missing "{" error right were I started. It is still driving me nuts.

By the way, I had served onboard this ship during this time and was a gunner for turret 2 and to let you know, General Quarters is the actual voice alert issued by the personel on the bridge which call for everyone to man there battle stations though out the ship.

Set condition zebra comes from a classification on how watertight security is through out the ship. Contition X-ray, Yoke and zebra are the three condtions, where each Letter is assignged to a particular hatchway and X being that most hatchways are open during normal working hours, Medium security is Yoke and Zebra meaning that all Hatchways are closed, making sure that if the ship is hit, it will remain bouyant.

Smoking Lamp is an old naval term coming from the days of the wooden ships where there was only one source of flame to light a pipe or cigar for smoke break (located at the main mast), which was turned off when a certain condtion applied in order not to have an accidental fire.

What I am attemption with this program is to be able to form a loop where one the guns were fired, if the captain had to order Fire control to reload, then the coordinates can be given again.

In actuality this sample game can be more complicated since we are dealing with different types of ammo, such as armour piercing, non-frag, frag, anti-personell (diamond) which released diamond shape grenades from the rear of the projectile, and so on. Also, I have to be able to take in account of the spead of the ship, gun angle elevation, wind speed, max range for full charge and reduced charge, etc.

But right now I am just trying to keep it simple.
Let me know if you have any ideas.
Many thanks for your input.

In the given example above, when we want to output the character in the loop, we call the function output.

But see how it defines both the name of the function as well as the argument that is passed to it? What you have in your code is just... floating code. No definition, no return type, no setup of any kind.

The compiler basically sees this code, passed return 0;, & is like... wtf do you want me to do with this?

The computer does as it's told. Not what it thinks you are up to. So you have to be exact sometimes, otherwise it freaks out.

In the given example above, when we want to output the character in the loop, we call the function output.

But see how it defines both the name of the function as well as the argument that is passed to it? What you have in your code is just... floating code. No definition, no return type, no setup of any kind.

The compiler basically sees this code, passed return 0;, & is like... wtf do you want me to do with this?

The computer does as it's told. Not what it thinks you are up to. So you have to be exact sometimes, otherwise it freaks out.

No. 2 Pencil,
I do appreciate the advice, but Keep in mind that I am still just a rookie in this and fail to associate the definitions of some of the wording that you gave me for the example that I can relate to.

I tried to do a function based on "char choice( char y, char n)" but it does not work for me. I need to know how do I make this return back to the entering of the coordinates when a "y" is selected and how to terminate if a "n" is entered.

It does have to in a function form, with a do-while loop. Being that I am hard headed. I need for you to exp[lain within the same descriptions, then I will understand what I am doing wrong.

Re: Problem with do-while loop

The suggestions from KYA were based on the idea of incorporating the 'lost code' into main().

Your idea of making it a separate function and calling it from main() is a fine idea too.

There is more than one way to do it but everything in the thread has been about that block of dislocated code that you are pointing to so yes, you aren't the first one to see that as the problem.

Dear Janotte,
I want to thank you for addressing the point of looking at details and appreciate that you are helping me work this out. The training is good, however, understanding functions is a little confusing for me right now. I have tried, looking through the theory, and all arrangements possible. (The book that I am using is the Herbert Schildt second edition).

Yes the program works for me as you will see however, it is not the way I want it to work, here is a modified version of the earlier program:

Yes, notice that I corrected the mispelling od "quarters"...thanks, I can blame this on my wide fingers and poor glasses.

What I want it to do is when Fire control gets permision from the bridge to reload and fire, the program should take me back to the Turret selection andthrough the sequuence of firing until it is given a cease fire.

Breaking it down into little chunks will let you control each piece far more easily (much like the co-ordinated sequence of calls and responses needed to have the guns fired in your example makes each step simple and foolproof a lot of calls to smallish functions makes things safe and robust.

Then it should be far easier to work out which chunks belong in a fire/reload/fire again loop and it will be fairly trivial to enclose them in a do/while() loop (or whatever type of loop you think is best).