CSE 303 Concepts and Tools for Software Development

Slides:



Advertisements
Similar presentations
A C++ Crash Course Part II UW Association for Computing Machinery Questions & Feedback.
Advertisements

C++ Language Fundamentals. 2 Contents 1. Introduction to C++ 2. Basic syntax rules 3. Declaring and using variables.
Introduction to Programming in C++ John Galletly.
Transition from C to C++ …and a Review of Basic Problem Solving.
ITEC 320 Lecture 24 OO in Ada (2). Review Questions? Inheritance in Ada.
Lab#1 (14/3/1431h) Introduction To java programming cs425
CSE 374 Programming Concepts & Tools Hal Perkins Winter 2012 Lecture 19 – Introduction to C++
C++ & Java Dick Steflik CS-248. Similarities Syntax - almost identical Object Model - very similar Stream based I/O.
Lecture 27 Exam outline Boxing of primitive types in Java 1.5 Generic types in Java 1.5.
C++ Training Datascope Lawrence D’Antonio Lecture 1 Quiz 1.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles C/C++ Emery Berger and Mark Corner University of Massachusetts.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
CSE 332: C++ program structure and development environment C++ Program Structure (and tools) Today we’ll talk generally about C++ development (plus a few.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
C++ for Java Programmers Chapter 1 Basic Philosophical Differences.
EC-241 OBJECT-ORIENTED PROGRAMMING (OOP)
Java and C++, The Difference An introduction Unit - 00.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
By – Tanvir Alam.  This tutorial offers several things.  You’ll see some neat features of the language.  You’ll learn the right things to google. 
May 9, 2002Serguei A. Mokhov, 1 Kickstart Intro to Java Part I COMP346/ Operating Systems Revision 1.6 February 9, 2004.
Rossella Lau Lecture 1, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 1: Introduction What this course is about:
Week 14 - Monday.  What did we talk about last time?  Introduction to C++  Input and output  Functions  Overloadable  Default parameters  Pass.
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 12/6/2006 Lecture 24 – Profilers.
Lecture 19 CIS 208 Wednesday, April 06, Welcome to C++ Basic program style and I/O Class Creation Templates.
A-1 © 2000 UW CSE University of Washington Computer Programming I Lecture 21: Course Wrap-up and Look Ahead.
Java and C++ Transitioning. A simple example public class HelloWorldApp { public static void main(String[] args) { //Display the string. System.out.println("Hello.
CSC 143A 1 CSC 143 Introduction to C++ [Appendix A]
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 19 – Introduction to C++
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 10/11/2006 Lecture 7 – Introduction to C.
Generic Programming and Library Design Brian Bartman
Object Oriented Programming Lecture 2: BallWorld.
FASTFAST All rights reserved © MEP Make programming fun again.
Week 13 - Friday.  What did we talk about last time?  Server communications on a socket  Function pointers.
Chapter 15 - C++ As A "Better C"
Prof. Bhushan Trivedi Director GLS Institute of Computer Technology
CSE 374 Programming Concepts & Tools
Hank Childs, University of Oregon
Object Oriented Programming in
C ++ MULTIPLE CHOICE QUESTION
CSE 374 Programming Concepts & Tools
C# for C++ Programmers 1.
Introduction to C++ (Extensions to C)
Eugene Hsu.
CSE 374 Programming Concepts & Tools
C Programming Tutorial – Part I
An Introduction to C Programming
CSE 303 Concepts and Tools for Software Development
Week 14 - Monday CS222.
CSE 374 Programming Concepts & Tools
CISC/CMPE320 - Prof. McLeod
C++ History C++ was designed at AT&T Bell Labs by Bjarne Stroustrup in the early 80's Based on the ‘C’ programming language C++ language standardised in.
CS212: Object Oriented Analysis and Design
C++ -> Java - A High School Teacher's Perspective
C# In many ways, C# looks similar to Java
Programming with ANSI C ++
CSCE 121- Spring 2016 J. Michael Moore
Brought to you by C++ Tutorial Brought to you by
Operator Overloading; String and Array Objects
CSE 303 Concepts and Tools for Software Development
Object-Oriented Programming Paradigm
CSE 303 Concepts and Tools for Software Development
Object Oriented Programming
CSE 303 Concepts and Tools for Software Development
Today’s Objectives 28-Jun-2006 Announcements
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
SPL – PS1 Introduction to C++.
CSE 303 Concepts and Tools for Software Development
CSE 303 Concepts and Tools for Software Development
Presentation transcript:

CSE 303 Concepts and Tools for Software Development CSE 303 Lecture 14 11/3/2006 CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 11/3/2006 Lecture 14 – Introduction to C++

Administravia Midterm Exam Too Long Mostly due to problem 4(b) It way too much to write out Some haven't had data structures yet We'll try to correct the situation Try to be fair to those who invested time in 4(b) Try to get back to you on Wednesday 11/3/2006 CSE 303 Lecture 14

Where We Are C language Good for low-level programming work Unsafe Operating Systems Embedded systems Unsafe Not Object-oriented Primitive Standard library Very few built-in types (arrays, structs) Awkward strings and file I/O 11/3/2006 CSE 303 Lecture 14

Introducing C++ Java C C++ Ideal for what tasks? High-level Low-level Safety Safe Unsafe Object-Oriented Yes No Standard Library Large Small Medium 11/3/2006 CSE 303 Lecture 14

Today Working with C++ I/O & Strings Vectors Type casting 11/3/2006 CSE 303 Lecture 14

C++ In a Nutshell Contains all of C Like Java, but… Almost backward-compatible (see CHello.cpp) Some new keywords (not many!) Compiled/Linked differently Like Java, but… Distinguishes objects and pointers-to-objects Reference Parameters More OO features Multiple Inheritence, non-virtual functions… Templates, Operator Overloading, etc… 11/3/2006 CSE 303 Lecture 14

Working with C++ File names end in ".cpp" Compiling Managing Files But other conventions abound .cxx, .C, .cc Compiling Use g++ instead of gcc g++ -g -Wall -o Hello Hello.cpp Managing Files Use headers and source files as in C No "one-class-per-file" restriction as in Java 11/3/2006 CSE 303 Lecture 14

C++ Namespaces Allows grouping of function/class names Not found in C (all names global!) Similar to Java Packages C++ Standard Library is in namespace "std" Compare Hello.java with Hello.cpp 11/3/2006 CSE 303 Lecture 14

C++ Strings, I/O Strings I/O We'll go into more depth later Like in Java, but mutable I/O New objects for stdin, stdout, stderr cin, cout, cerr << and >> have automatic type conversion We'll go into more depth later Example in StringsIO.cpp & Vector.cpp 11/3/2006 CSE 303 Lecture 14

C++ Vectors Vectors We'll go into more depth later An object that works like an array Like Java ArrayList Parameterized by type (using templates) Can grow and shrink dynamically We'll go into more depth later Example in Vector.cpp 11/3/2006 CSE 303 Lecture 14

C++ Type Casting New type casting syntax (primitive types) C way: int i = (int)d; C way still works in C++ New C++ way #1: int i = int(d); Can't use for type names like unsigned int New C++ way #2: int i = static_cast<int>(d); Helpful, because it's more explicit We'll cover dynamic_cast later. 11/3/2006 CSE 303 Lecture 14

Summary Working with C++ I/O & Strings Vectors Type casting 11/3/2006 CSE 303 Lecture 14

Reading C++ for Java Programmers Remember, it doesn't know you know C! Chapter 1: Basic Types and Control Structs. Chapter 2: Strings and Parameter Passing Remember, it doesn't know you know C! 11/3/2006 CSE 303 Lecture 14

Next Time C++ Parameter Passing Debuggers 11/3/2006 CSE 303 Lecture 14