How to create a console application in C++Builder

Abstract: How to create a console application in C++Builder

How to create a console application in C++Builder

  • Product Name:��C++Builder�
  • Product Version:��All�
  • Product Component:��IDE�

    Platform/OS Version:� All

    Description:

    How can I create a console application using C++Builder?

    Answer/Solution:

    Step-by-step instructions on creating a new console application in C++Builder are as follows:

    **

    Select File | New | Other...

    **

    Click the New tab, select Console Wizard, and hit OK

    **

    Specify the appropriate Source Type (either C or C++), check Console Application, and hit OK

    **

    Enter your code into the code editor (you may either use the existing stub code or delete it all and start from scratch)

    **

    Hit F9 to build and run your program

    Note that, by default, console applications close immediately after executing.� So, to keep your console application's output onscreen after it runs, you may need to tell it to wait for a keystroke before closing.� To do this, you can #include the header file conio.h and then call the getch() function just before your main() function returns, like so:

    //--------------------
    #include
    #include

    int main()
    {
    ���� cout << "Hello\n";
    ���� getch();
    ���� return 0;
    }
    //--------------------

    Author:� Yu-Chen Hsueh