Lecture 1 - Page 29 : 29
Notes about C++
From C to C++
* Course Introduction
Overview of Advanced Programming - Part One
Overview of Advanced Programming - Part Two
Recommended use of your time
Course Approach - Part 1
Course Exam
Which compiler or IDE?
* A quick tour of C
Basic Observations
The Evolution of C
The Popularity of C and C++
The C preprocessor
Fundamental types
Arrays and Pointers
Arrays and Pointers: Examples
Structures and Unions
Structures: Examples
Function types
User defined types
Expressions and operators
Control structures
Functions and parameters
Call-by-reference parameters via pointers
C Program organization
Memory Allocation
The standard library
* C/C++ Compatibility
C/C++ Compatibility
C/C++ Compatibility - some small details
C/C++ Compatibility - some small details
Most of details mentioned below do not appear in everyday C programs
The C++ Programming Language
: Page 816
Comments
//
comments are supported in C++ and C99, but not in ANSI C (C89)
Functions without argument types
Legal in C - but poor style in C. Not legal i C++.
A type is
int
if not specified
Possible in C, but poor style. Not legal i C++
'Inline' structs in return type and in parameter lists
Possible in C. Not legal i C++.
Enumeration types
In C a variable of enumeration type can be assigned to an integer.
Not possible in C++.
Multiple definitions at global level
Global data definitions may be repeated in C. Not in C++.
Pointers to void
may in C be assigned to variables of any pointer type. Not in C++.
Static
In the meaning of 'local to translation unit' is deprecated in C++.
Casts
C-style casts should have been decrepated...
C++ has other means for casting.
Examples appear in appendix B.2 in
The C++ Programming Language