Tuesday, December 05, 2006 I hear and I forget, I see and I remember, I do and I understand -Chinese Proverb
CS 192 / CMPE 191 §First course in programming using C++
§Course Outline §Course Website URL l Information about the course, office hours, contact information, announcements, lecture- slides, tutorials, source code … §\\indus\Common\cs192w06 §Overview of C++ CS192 / CMPE 191 ‘Problem Solving and Computer Programming’
§Make use of office hours.
§Course builds on top of previous discussion. §Don’t hesitate to ask questions in class.
5 minute rule!
What is a program? -
§C++ programming language. High level language
§What does the computer understand?
§What do we need here?
#include int main() { cout<<“Hello\n”; } myprogram.c Type your C++ program into a text file It is human-readable myprogram.exe machine-readable
§Compiler §Source code §Object code
§What happens when you start a program?
C++ l What’s with the name?
§In 1970s l Developed by Dennis Ritchie of AT&T Bell Laboratories l It was first used for writing UNIX operating system §Widely used in programmer community §ANSI (American National Standards Institution) standard C (1983) Some history …
Advantages of C §Built-in power §Efficiency §Flexibility § Library routines
From C to C++ (1980 – Bell Labs) §Reason : Increasing complexity of programs §Bjarne Stroustrup of AT&T Bell Laboratories developed C++ in 1980s. §Most of C is a subset of C++
From C to C++ (1980 – Bell Labs) §High performance system software is constructed using C++ §C++: Enhancement to C
Real programmers language Also it is …
a lot ofFUN!
§Computer Science Fundamentals (CS 111) §Object Oriented Programming (CS 292) §Data Structures (CS 213) §Operating Systems (CS 381)
My assumptions Knowledge of l A text editor l Files l Some experience of using Windows operating system. l General knowledge of what computer hardware / software is.
§Basic C++ Program Structure. §Statements
§Input / Output (I/O)
§Compiler §Linker
#include int main( ) { cout <<"Welcome to CS192/CMPE191"; return 0; }
§Include directives
iostream is the name of library that contains definition of routines that handle input and output. iostream.h is a file that contains information about this library
Welcome to CS192/CMPE191
Comments have two forms in C++ //Single line comments /*Multi-line comments*/ /* comments ignored by compiler */ // comments required by some organizations!