Introduction To C++: CS-2303 System Programming Concepts
Introduction To C++: CS-2303 System Programming Concepts
CS-2303
System Programming Concepts
(Slides include materials from The C Programming Language, 2nd edition, by Kernighan and Ritchie and
from C: How to Program, 5th and 6th editions, by Deitel and Deitel)
• For reference:–
– Bjarne Stroustrup, The C++ Programming
Language: Special Edition
– Nicolai M. Josuttis, The C++ Standard
Library: A Tutorial and Reference
• File types
.cc, .cp, .cpp, .CPP, .cxx, .c++, .C
.h, .H Some of these have special properties.
• <cmath>
• sqrt()
C++ keywords
C++ keywords
C++-only keywords
r = 2; // j now is 2
} //f Sometimes, reference
declarations are written as
int k; int& r1 = k
• C++ version
void swap (int &a, int &b) {
int temp = a;
a = b; Non-hazard: no pointer here
b = temp;
} // void swap(…)