Results 1 to 5 of 5

Thread: Simple - Just new environment for me

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    75

    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?
    We Jammin

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    You can use system("anything")...........where anything is something that can be interpreted by dos........
    [p r a e t o r i a n]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2001
    Posts
    75

    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???
    We Jammin

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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
  •  



Click Here to Expand Forum to Full Width