|
-
Nov 15th, 2001, 03:22 PM
#1
Thread Starter
Lively Member
Simple - Just new environment for me
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?
-
Nov 15th, 2001, 03:42 PM
#2
Monday Morning Lunatic
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 
clrscr doesn't exist, use system("cls"):
Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
cout << "Hello there!" << endl;
system("pause");
system("cls");
return 0;
}
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Nov 17th, 2001, 07:33 AM
#3
Addicted Member
You can use system("anything")...........where anything is something that can be interpreted by dos........
-
Nov 17th, 2001, 08:40 AM
#4
Thread Starter
Lively Member
I knew of the command but forgiot it
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???
-
Nov 17th, 2001, 02:41 PM
#5
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()).
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|