Looking for functions for Visual C++ that are an equivalent to Borland's gettext() & puttext() ---> used to manipulate terminal screen.
Printable View
Looking for functions for Visual C++ that are an equivalent to Borland's gettext() & puttext() ---> used to manipulate terminal screen.
Look up cout and cin. Here is a simple program.
Let me know if you have any questions.Code:#include <iostream>
using namespace std;
int main( void )
{
int num;
cout << "Enter a number: ";
cin >> num;
cout << "You enetered " << num << endl;
return 0;
}
from what I'm understanding you are looking for printf and scanf
ex
printf("Hello World");
or
x = "Hello World";
printf("%s" ,x);
and
int i;
scanf("%d" ,&i);
Yes, but he posted this on the C++ board.Quote:
Originally posted by shuesty
from what I'm understanding you are looking for printf and scanf
ex
printf("Hello World");
or
x = "Hello World";
printf("%s" ,x);
and
int i;
scanf("%d" ,&i);
yes, but cout (console output) and cin (console input) are more standard C++
What can I say I'm a die hard c fan ... that and it's all that's been pounded into my head at university so far. Also I'm working with VC++ .Net and I've gotten it to work. But I can appreciate the importance of cin and cout.
Well anything that works in C also works in C++ :)Quote:
Originally posted by shuesty
What can I say I'm a die hard c fan ... that and it's all that's been pounded into my head at university so far. Also I'm working with VC++ .Net and I've gotten it to work. But I can appreciate the importance of cin and cout.
Appreciate the responces...but. Here's the scenario
I need to capture a certain portion of a terminal window, save it, and then restore it. Saving? into a dynamically allocated array, how? simple, i just the functions!!!!!
[code][/code]tagged by SalemCode://here's some clarification
}
char *buffer;
#if PLATFORM == AIX //unix
buffer = (char *)malloc(height * width);
for (i = 0; i < height; i++)
for (j = 0; j < width; j++)
buffer[idx++] = mvinch(row + i, col + j);
#elif PLATFORM == BC //borland
buffer = (char *)malloc(height * width * 2);
gettext(col + 1, row + 1, col + width, row + height, buffer);
#elif PLATFORM == VC //visual c++
/*THIS IS WHAT I NEED*/
#endif
}
>I need to capture a certain portion of a terminal window, save it, and then restore it.
When you write to the screen, save all of the data to a buffer and write the buffer to the screen. Then you have the buffer which can be used later.
-Prelude