[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
BeginnersGuideToCPlusPlus
C++ is used to develop a wide variety of applications. Most C++ compilers, including MS-Visual C++ and Borland C++ Builder, develop Graphical User Interface (GUI) applications. C++ is also used in scientific applications. Being a high-level object-oriented language, it makes it easier for the programmer to simulate the scientific problem.
Usually, each header file in C++ corresponds to a class declaration, while source files contain the class definition/implementation.
Classes rather than functions are the cornerstone in C++. Classes contain all the member variables and functions which are automatically associated with any instance of the class. Classes usually represent actual entities in our life such as cars, trains, the human brain, etc. which makes the programming easier.
You can create a new project workspace in Visual C++ by following these steps:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
BeginnersGuideToCPlusPlus
(C++) Beginners Guide
Brief History
In early 1980, Bjarne Stroustrup from Bell labs began the development of the C++ language. In October 1985, the first commercial release of the language appeared and along with the first edition of the book "The C++ Programming Language" by Bjarne Stroustrup.What is C++?
C++ is a high-level object-oriented programming (also referred to as OOP) language that builds on the C language. It contains everything C does, and adds the power of OOP. Object-oriented ideas are so easy even children can (and do) understand them. Our minds think in objects, and are trained to do so from day one. Combine the easy to understand ideas behind OOP with the power of abstraction, inheritance, exceptions, etc. and you have a language that can make large, complex projects easier to develop and maintain.What Can C++ Be Used For?
More than anything, C++ is being used to extend and build on what is already there. For example, the Microsoft Foundation Classes provide a C++ interface to the C Windows Application Programming Interface (or API). KDE provides an OOP interface for X Windows.C++ is used to develop a wide variety of applications. Most C++ compilers, including MS-Visual C++ and Borland C++ Builder, develop Graphical User Interface (GUI) applications. C++ is also used in scientific applications. Being a high-level object-oriented language, it makes it easier for the programmer to simulate the scientific problem.
What Is The Syntax Like?
C++ compilers are compatible with C syntax. C++ adds the object-oriented programming facilities. Similar to C, C++ programs are written in several files. Usually you will have a group of source code files that are compiled separately, then linked together into a single executable file. Each source code file will have a header file that describes its contents.Usually, each header file in C++ corresponds to a class declaration, while source files contain the class definition/implementation.
Classes rather than functions are the cornerstone in C++. Classes contain all the member variables and functions which are automatically associated with any instance of the class. Classes usually represent actual entities in our life such as cars, trains, the human brain, etc. which makes the programming easier.
An Example C++ Program
This is an example of a C++ program making use of MFC classes and Visual Studio Application Wizard.You can create a new project workspace in Visual C++ by following these steps:
- Select File | New. This opens the New Wizard.
- On the Projects tab, select MFC AppWizard (exe).
- Type a name for your project, such as Hello, in the Project Name field.
- Click OK. This causes the New Wizard to do two things:
- Create a project directory (specified in the Location field)
- Start the AppWizard.
- In Step 1 of the AppWizard, specify that you want to create a Single-Document application.
- Click Finish at the bottom of the wizard.
void CHelloView::OnDraw(CDC* pDC)
{
CAsdDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// Display a short message to the user
pDC->TextOut(0,0,"Hello World!");
}
What Do I Need To Get Started?
You will need a C++ compiler. This is available for free with any UNIX-based operating system, including Linux. You can download Borland C++Builder (if you are using Windows), Dev c++, DJGPP (Gcc for Windows) or GNU C++ (gcc) (if you are using Linux). These compilers can be used for both C and C++.Are There Any C Tools I Can Buy?
You can buy a whole range of C++ development tools for Windows from Borland. You can also buy Visual Studio.NET from Microsoft which includes Visual C++.NET.What Does Programmers Heaven Offer Me?
Visit the C++ Section of the site to see articles on C++ as well as source code, development tools and links to many sites, including tutorials pitched at many different levels. If you need assistance, why not post your question on our friendly and lively C++ message board?[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
