Click here to Skip to main content
15,867,686 members
Articles / Containers / Virtual Machine

Skills and Concepts to Program in C++

Rate me:
Please Sign up or sign in to vote.
1.26/5 (31 votes)
7 May 2003CPOL2 min read 50.4K   14   4
Learn the Skills and Concepts to Program in C++ for Beginner & Intermediate/step by step

Day 1: Getting Started

Today You Will Learn

  • Why C++ is the emerging standard in software development
  • The step to develop a C++ program
  • How to enter, compile, and link your first working C++ program

A Brief History of C++

Computer languages have undergone dramatic evolution since the first electronic computers were built to assist in artillery trajectory calculations during World War II. Early on, programmers worked with the most primitive computer instructions: machine language. These instructions were represented by long strings of one and zeros, assemblers were invented to map machine instructions to human-readable and -manageable mnemonics, such as ADD and MOV. In time, higher-level languages evolved, such as BASIC and COBOL. Some languages, such as Microsoft Visual Basic, call the interpreter the runtime library. Java calls its runtime interpreter a Virtual Machine (VM), but in this case VM is provided by the browser (Such as Internet Explorer or Netscape). C++ calls interpreter translates a program as it reads it, turning the program instructions, or code, directly into actions. A compiler translates the code into intermediary form. This step is called compiling, and it produces an object file. The compiler then invokes a linker, which turns the object file into an executable program.

Solving Problems

The problems programmers are asked to solve today are totally different from the problems that programmers were solving twenty years ago. In the 1980s, programs were created to manage large amounts of raw data. The people writing the code and the people using the program were all computer professionals. Today, computers are in use by far more people, and most know very little about how computers and programs work.

Your First C++ Program : "Hello World"

Traditional programming begins by writing the words "Hello World" to the screen, or a variation on that statement.

Building the Hello World Project

To create and test the Hello World program, follow these steps:

  1. Start the compiler.
  2. Choose File, New from the menus.
  3. Choose Win32 Console Application and enter a project name, such as Example 1, and click OK.
  4. Choose An Empty Project from the menu of choices and click OK.
  5. Choose File, New from the menus.
  6. Choose C++ source file and name it ex1.
  7. Enter the code as showing "Listing 1.1".
  8. Choose Build, Build Example1.exe.
  9. Check that you have no build errors.
  10. Press Control+F5 to run the program.
  11. Press the Spacebar to end the program.

Note: As you prepare for your first C++ program, you will need a few things: a compiler, an editor such as Microsoft Visual C++.

C#
//Listing 1.1
#include <iostream>

int main()
{
       std::cout << "Hello World!\n";
       return 0;
}

History

  • 8th May, 2003: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Could be better Pin
Nader Omar9-May-03 11:12
Nader Omar9-May-03 11:12 
GeneralCould be better Pin
Ian Darling8-May-03 22:49
Ian Darling8-May-03 22:49 
GeneralRe: Could be better Pin
Warbit25-Aug-08 0:22
Warbit25-Aug-08 0:22 
GeneralRe: :) Pin
Martyn Pearson9-May-03 1:14
Martyn Pearson9-May-03 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.