[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppBuilderConsoleHelloWorld

(C++ Builder) Hello World program, console version

See the C++ Hello World program for detailed information about the code.

  1. First do 'File | Close All'
  2. Do 'File | New | Other | Console Wizard'
  3. In the Console Wizard, set 'Source Type' to C++, uncheck 'Use VCL', uncheck 'Use CLX', uncheck 'Multi-threaded', check 'Console Application', click OK.
Now the Code Editor shows a default minimal program:
//---------------------------------------------------------------------------
  1. pragma hdrstop
//---------------------------------------------------------------------------
  1. pragma argsused
int main(int argc, char* argv[]) { return 0; } //---------------------------------------------------------------------------


Make this a Hello World program, by replacing it with the standard C++ Hello World program:
  1. include <iostream>
int main() { std::cout <<"Hello World" << std::endl; return 0; }


As C++ Builder automatically closes the console window after the program has executed, you might want to add a line to wait for a character input:

  1. include <iostream>
int main() { std::cout <<"Hello World" << std::endl; std::cin.get(); return 0; }


Again, see the C++ Hello World program for detailed information about the code.

'Hello world' links



last edited (December 1, 2006) by bilderbikkel, Number of views: 3744, Current Rev: 6 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.