Hello, I'm working on a program that requires an XY coordinate plan and I can't seem to find a source anywhere!! that shows how to print a "." or "+" or anything at a certain xy coordinate on the screen.

for instance, I need to be able to take 2 integers (or even real numbers preferably), put them into (x,y) form and then print on the window where they are.

If this makes sense and you could explain the coding for it, it would greatly help me in completing this program! thank you!!

Your not going to be able to do this precisely with C++. You need to use graphics API like openGL. But here is some psuedo-code:

void showCoordinate(int x, int y){
 string coord = "(" + toString(x) + "," + toString(y) + ")";
 printOnScreen(coord);
}
template<typename T>
string toString(const T& src){
 stringstream ss;
 ss << src;
 return ss.str();
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.