I wish to cout<< in this case "blahhhhhhhhhhhhhhhhhhhhhhhhhh";
in a small box in the corner of my console and only in the small box in my console...
however i don't want to have to alter my text every time i do it so it fits...
I just want to type " blahhhhhhhhhhhh" and if the box ends half way in between " blahhhhhhhhhhhh" then it simply cout<<s the rest on the next line...
This is what i have....
thought about it donno how to do it from here...]
MSVC++ 6.0
--------------------------------------------------------
#include <iostream.h>
#include <windows.h>
void VidScr(const char*);
void gotoxy(int x, int y);
int main()
{
VidScr("Blahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh");
return 0;
}
void VidScr(const char display[255])
{
int length = strlen(display);
gotoxy(1,15);
cout<< "=============================="<<endl;
gotoxy(1,1);
cout<< "================================================= ============================"<<endl;
for (int j=2;j<=22;j++)
{
gotoxy(1,j);
cout<< "|"<<endl;
}
for (int k=2;k<=22;k++)
{
gotoxy(77,k);
cout<< "|"<<endl;
}
for (int i=16;i<=22;i++)
{
gotoxy(30,i);
cout<< "|"<<endl;
}
gotoxy(1,23);
cout<< "================================================= ============================"<<endl;
gotoxy(2,16);
cout<< display<<endl;
i=0;
}
gotoxy(1,24);
}
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
}