Question (C++)

Started by
11 comments, last by BioSquirrel 22 years, 3 months ago
Try this:

  #include <windows.h>#include <iostream.h>HANDLE H_OUTPUT = GetStdHandle(STD_OUTPUT_HANDLE); // This will be your hadle to print											// a char anywhere you want.  You need this.void PrintChar(int x, int y, char* CH){	COORD cursor = {x, y};  //This is a struct that is found in windows.h that you need for							//Setting the cursor position.  All it is is two ints that tell							//called X and Y that tell where you want the cursor to be. 							//0,0 will be the top left corner, where 79, 24 will be the bottom							//right corner.  Dont go under 0,0 or 79,24.	SetConsoleCursorPosition(H_OUTPUT, cursor);  //This places the cursor at the coord you wnated.	cout << CH;}int main(){		char CH[] = "Hi";	int x = 35;	int y = 15;		//Playe with the x and y values just dont make x higher than 79 or make y higher than 24.	PrintChar(x, y, CH);	return 0;}  



Suffered seven plagues, but refused to let the slaves go free. ~ Ross Atherton
Suffered seven plagues, but refused to let the slaves go free. ~ Ross Atherton
Advertisement
This is nice! I really had no idea that this was possible.
O and using arrays for the map did work...I just had to rewrite the whole thing...

This topic is closed to new replies.

Advertisement