Lecture4 - Outline CS11600: Introduction to Computer...

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

View Full Document Right Arrow Icon
CS11600: Introduction to Computer Programming (C++) Lecture 4 Svetlozar Nestorov University of Chicago 1/15/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 2 Outline ± Introduction to C and C++ ± “Hello World!” program ± Basic types ± Variables, constants and assignments ± Expressions and operators ± Control flow ± Input/Output (I/O) 1/15/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 3 Introduction to C and C++ ± The history of C and C++ http://cm.bell-labs.com/cm/cs/who/dmr/chist.html • C was devised in 70’s at Bell Labs • Predecessors of C: BCPL, B. •S tanda rd i za t ion : ANSI C in 1989. • C++ is the most widely used successor of C. ± Differences between C and C++ 1/15/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 4 “Hello World” Programs ± C program #include <stdio.h> int main() { int year = 2003; printf("Hello %d World!\n“, year); } ± C++ program #include <iostream.h> int main() { int year = 2003; cout << “Hello ” << year << “ World!” << endl; } 1/15/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 5 Built-in Types ± Integers (signed or unsigned): int, short, long ± Real numbers (always signed): float, double, long double ± Characters (signed or unsigned): char ± Others: wchar_t, bool 1/15/2003 Svetlozar Nestorov, CS 116: Intro to Programming II 6 Variables ± Variable definition:
Background image of page 1

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

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

Page1 / 4

Lecture4 - Outline CS11600: Introduction to Computer...

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

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