03introCpp_3014

03introCpp_3014 - Lecture File 03 COP 3014 August 22, 2010...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture File 03 COP 3014 August 22, 2010 A. Ford Tyson 1 ± Introduction to C++ – a little history COP 3014 Lecture File 03 1 – first example program – identifiers – data types – variables and constants Copyright 1997-present, Ann Ford Tyson 1967 : "BCPL" Language ( Martin Richards, Cambridge ) 1970 : "B" Language ( Ken Thompson, Bell Labs ) used to write first UNIX 1972 : "C" Language (Dennis Ritchie, Bell) Introduction to the C++ Language 2 1985 : "C++" (Bjarne Stroustrup, Bell) Goal: a full-featured language 1998 Most portable version ISO/ANSI Standard C++ • standard syntax determined by national and international committees • what we use in this course C++ Language Characteristics ± General Purpose ± Usage: Imperative/Procedural (task- oriented) programming or Objec 3 oriented) programming or Object- Oriented (data-oriented) programming ± Block-Structured
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Lecture File 03 COP 3014 August 22, 2010 A. Ford Tyson 2 { declarations executable statements } a C++ program consists of one or more Block 4 - a C++ program consists of one or more functions - function == subroutine == section of a program performing a particular task - one function must be called main - every function contains a block C++: built-in features vs library features ± the C++ language provides a base set of capabilities ± many additional features are provided in 5 many additional features are provided in standard libraries ± example: C++ does not provide built-in I/O (input/output); we must use the standard I/O library Using Libraries ± A C++ library has two parts – interface ( header file) • declares names of items contained in library • indicates how to use them • names are declared in a namespace 6 – implementation (separate file) • defines actual operations of the library contents (executable code) ± We are concerned primarily with the header files, which allow us to use the library features
Background image of page 2
Lecture File 03 COP 3014 August 22, 2010 A. Ford Tyson 3 #include <iostream> // pre-processor // directive using namespace std; // for standard I/O int main ( ) // main function /* First example C++ program */ 7 { int sum; // storage for integer sum = 5 + 6; // assignment cout << sum; // print result return (0); // return value to OS
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/14/2011 for the course COP 3014 taught by Professor Tyson during the Fall '10 term at FSU.

Page1 / 12

03introCpp_3014 - Lecture File 03 COP 3014 August 22, 2010...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online