Newbie if statement headache &&

Hello daniweb peeps, been learning c++ from a beginners book for the past week or two but have got myself a bit confused, follows is the code that compiles but isn't doing what i want it to (Im hoping the fault is obvious!)

My issue is, the while statement is obviously becoming true and ending my loop too early, it will say "scout arrived at 100,200" - it will of jumped, it seems to be that the while statement is not looking at the && section and is just using part of it..

Remember to word your replies if there are any in easy terms,
thanks for any input you may have!
cheers
Paul

(i did use search etc but nothing of any relevence to my basic question!)

After reviewing your loop, this seems to be the correct output in order to establish the terminating condition of your loop.. where toX == currentX AND toY == currentY... which will occur when toX becomes 100 (which is the initialized value of currentX) and toY becomes 200 (which is the initialized value of currentY)

A unit will be able to travel to - (minus) grid co-ords not just positive, so the 'useless' code would allow a unit to travel to -200,-100 for example.

If you just pop that code into your favourite compiler and build it, you'll see that the X and Y current coords (as outputted using cout), they go up together in each loop, but once the X coord reaches toX the loop/do while loop breaks out - which isn't what i want.

I want (for ex) the Y co-ord to carry on incrementing but have the X co-ord stay as it is.
Here is a concrete example of this:

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...