Board index » cppbuilder » Console Apps. setting up

Console Apps. setting up


2004-01-22 03:19:21 AM
cppbuilder74
Hi
I recently purchased Builder6 and i am still learning C++. I have
several manuals but none define how to enter basic C++ code without creating a window's program. I have J. Liberty's book
Learn C++ in 21 day's. I would simply like to enter the books code compile link debug run. I need instructions on how to specifically carry this out. If you know of any additional support literature like Jessies book that would also be greatly
appreciated. The compiler is fantastic and i am learning how to
navigate through but the C++ code for most of the window's programs is still over my head. I have a strong background in C
but one step at a time...Thanks for a great product.Tom Holly
 
 

Re:Console Apps. setting up

File->New->Console Wizard
put a break point on the last line of your code in main or a getch() so that
the dos window does not disappear right away.
 

Re:Console Apps. setting up

1 - C++Builder 6 (and 5, 4, 3) will normally open with a Form. Close it.
File ->Close All
2 - Open a text edit window to create a console application:
File ->New ->Other (Opens the New Items window).
Select "Console Wizard" (Opens the Console Wizard).
Select C++ (or C if you prefer).
Check the "Console Application" box and then click the "OK" button.
3 - Write code.
4 - Run Code (Click green arrow or Click F9 or Run ->Run).
Example code:
//-----
#include <iostream>// may be <iostream.h>in some books
#include <conio.h>// A Borland library
#pragma hdrstop
using namespace std;
//-----
#pragma argsused
int main(int argc, char* argv[])
{
cout << "HELLO WORLD!" << endl << endl;
cout << "Press any key to exit.";
getch(); // defined in <conio.h>
return 0;
}
//-----
Regards
Tom Holly wrote:
Quote
Hi
I recently purchased Builder6 and i am still learning C++. I have
several manuals but none define how to enter basic C++ code without creating a window's program. I have J. Liberty's book
Learn C++ in 21 day's. I would simply like to enter the books code compile link debug run. I need instructions on how to specifically carry this out. If you know of any additional support literature like Jessies book that would also be greatly
appreciated. The compiler is fantastic and i am learning how to
navigate through but the C++ code for most of the window's programs is still over my head. I have a strong background in C
but one step at a time...Thanks for a great product.Tom Holly
 

{smallsort}