The following C++ program will print text Hello, World! on computer screen:
Our first program is constructed from the following parts:
Second line contains main entry point into our program. That is, when the
program is loaded into memory, its execution begins here. The word " Opening brace "{" indicates beginning of our function. Closing brace "}" ends the function. The braces require no special calculation and specify function body.
Statement Finally, the statement contains semicolon ";" at the end. This is part of C++ syntax: individual statements must finish with semicolons. Interestingly, semicolon is part of the statement itself, and is not a separator between multiple statements. |
Many free compilers exist today. Among them, Microsoft Visual C++ 2005 Development environment includes an editor with program code colorization, syntax checking, on-line help, and other tools. It enables to find and diagnose programming errors using program debugger with graphical user interface. In addition, Visual C++ allows writing portable, standards-conformant C++ programs that use advanced features of the language, based on concepts of object-oriented design and generic programming. Combination of these qualities makes Microsoft Visual C++ an attractive choice for many novice programmers and professional developers. For developing highly portable code, it is crucial to compile your programs by as many different compilers as possible, and VC++ is certainly one of them. Like many other graphical development environments, VC++ comes with its own terminology for configuration parameters associated with programming tasks. To begin using Microsoft Visual C++ in our homework assignments, we need to create a new project in Microsoft development environment. Essentially, project is a combination of configuration files, located in the project directory on the hard drive. Each project is placed inside a solution , which allows loading multiple projects into the VC++ for parallel work. When we create our first VC++ project, the solution will be automatically created for us. |
Our directory structure now includes a subdirectory for Visual C++ project files and the final directory tree looks like this: C:\ | '-CIS60 | '-Projects | `-main | +-Debug | | | `-main.exe (compiled executable file) | `-main.cpp (program source file) |