I know this topic has been posted a bunch of times, but I honestly don't know what I am doing wrong. It seems that the points displayed aren't what the user entered.
here is my code
------------------------------------------------------------------------------------
#include <windows.h> //wasn't sure what headers I needed
#include <stdlib.h> //so I included a bunch!
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
void gotoxy(int X, int Y) //you need this whenever you use
{ //gotoxy
COORD coord;
coord.X = X;
coord.Y = Y;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hConsole, coord);
}
void draw(int x1, int y1, int x2, int y2) //drawing function
{ //just draws a "." at the
//points
gotoxy(x1, y1); cout << ".";
gotoxy(x2, y2); cout << ".";
}
int main()
{
int x1, y1, x2, y2;
cout << "Enter your coordinates" << endl;
cout << "Point 1" << endl;
cin >> x1 >> y1;
cout << "Point2" << endl;
cin >> x2 >> y2;
gotoxy(0, 0);
system("CLS");
draw(x1, y1, x2, y2);
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
return 0;
}
------------------------------------------------------------------------------------
Like I said this kinda almost sort of works, but the actual output seems to not be what the user enters. Funky.