Coordinating system in console c++? -


i don't know wheres error. looks forgot basic stuff.

int xy [2]; cout << "input x: "; cin >> xy[0]; cout << "\ninput y: "; cin >> xy[1]; ( int y = 0; y < 10; y++ ) {     ( int x = 0; x < 10; x++)     {         if ( x = xy[0] + 5 && y == xy[1] + 5)         {             cout << "°";         }         else         {             cout << "+";         }     }     cout << "\n"; } 

may missed :

if ( x == xy[0] + 5 && y == xy[1] + 5)         ^ equality 

which why you're getting infinite loop

= assignment operator , while == used check equality

putting x= xy[0] + 5 assigns x value , rather comparing hence never ending inner loop


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -