Click here to Skip to main content
Click here to Skip to main content

Skills and Concepts to Program in C++

, 7 May 2003 CPOL
Rate this:
Please Sign up or sign in to vote.
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++.

//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)

Share

About the Author

Nader Omar
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
GeneralRe: Could be better PinmemberNader Omar9-May-03 12:12 
GeneralCould be better PinmemberIan Darling8-May-03 23:49 
GeneralRe: Could be better PinmemberWarbit25-Aug-08 1:22 
GeneralRe: :) PinmemberMartyn Pearson9-May-03 2:14 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.1 | Last Updated 8 May 2003
Article Copyright 2003 by Nader Omar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid