Slide 2 C++ C is a programming language developed in the 1970s with the UNIX operating system C is procedural, and efficient and portable across different hardware platforms C++ is a better C. and c is a subset of c++ C programs should run in C++ C++ supports Data abstraction object-oriented programming Generic programming
Slide 2 C++ • C is a programming language developed in the 1970s with the UNIX operating system • C is ‘procedural’, and efficient and portable across different hardware platforms • C++ is a better C, and C is a subset of C++ • C programs should run in C++ • C++ supports • Data abstraction • “object-oriented” programming • Generic programming
Slide 3 The first program #include <iostream> using namespace stdi int main(i cout < Hi!<< endl
Slide 3 The first program #include <iostream> using namespace std; int main(){ cout << “Hi!” << endl; }
Slide 4 Variables and assignments The most fundamental programming language constructs!
Slide 4 Variables and Assignments The most fundamental programming language constructs!
Slide 5 What is a variable? A variable(also an object) is a named memory location for a value (that we can write to, retrieve, and manipulate) X 1000 Name -n identifier Type - size It can be best thought of as a container/box for a value
Slide 5 What is a variable? Name --- identifier Type --- size A variable (also an object) is a named memory location for a value (that we can write to, retrieve, and manipulate) 1000 X It can be best thought of as a container/box for a value