I'm use to program in Turbo C but yesterday I took up Visaul C
I note clrsrc() fucntion is not recoginse using Visual.
What the function in Visual to clear the screen?
Printable View
I'm use to program in Turbo C but yesterday I took up Visaul C
I note clrsrc() fucntion is not recoginse using Visual.
What the function in Visual to clear the screen?
First thing...
...you may think it's just a new environment, but Turbo C++ was DOS and as such, 16-bit (i.e. int == 16 bits). Visual C++ is for Windows, and is 32-bit.
This means that things like near and far pointers are gone, you just declare a normal pointer and you get access to a 4gb flat memory space (although you'll get an access violation if you don't own the bit you want to read ;)).
But back to the question :D
clrscr doesn't exist, use system("cls"):Note - MSVC will put a pause at the end, but it only appears when you run the program through the IDE (i.e. with Ctrl-F5). The actual compiled program is as you've written it.Code:#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
cout << "Hello there!" << endl;
system("pause");
system("cls");
return 0;
}
You can use system("anything")...........where anything is something that can be interpreted by dos........
Now I realise all my dos commands won't work
cant use getdate function so now I'm tryign to figure how to read the system date using Visual C???
a TM struct contains that information. It is declared in time.h, but I forgot how to get it ( you extract it from a time_t that you get by calling time()).