Basic Structure of C++ Program -- Prashant Sharma

[Ed.: This is a simple short "hello world" overview for someone starting to program in C++, and is basically correct. There are lots of expert-friendly articles, but we like and want to encourage the beginner- and intermediate-level articles as well for the benefit of the many recent newcomers to the language.]

Basic Structure of C++ Program

The easiest way to understand the basic structure of C++ program is by writing a program. The basic C++ program is as follows: ...

Add a Comment

Comments are closed.

Comments (1)

1 1

matt said on Nov 23, 2013 06:51 AM:

IMHO, it's better to avoid introducing `using namespace std;` to beginners at all. Without knowing about namespace pollution (and various caveats this implies), it can only do more harm than good.

I might add that I'm even increasingly inclined to ban this completely (in a coding standards setting) -- unless you're an expert converting a gigantic legacy C codebase to C++, it's *extremely* unlikely you actually have a good, legitimate reason to resort to the using-directive: