Header files (answers to jit-anonymous questions)

Slides:



Advertisements
Similar presentations
Introduction to C++ An object-oriented language Unit - 01.
Advertisements

Hold data and provide access to it. Random-access containers: -Allow accessing any element by index -arrays, vectors Sequential containers: -Allow accessing.
Chapter 17 vector and Free Store John Keyser’s Modifications of Slides By Bjarne Stroustrup
C++ Templates. What is a template? Templates are type-generic versions of functions and/or classes Template functions and template classes can be used.
Chapter 9: The TC Shell Everything you thought you knew is now wrong.
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
Chapter 10.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
1 UNIX essentials (hands-on) the directory tree running programs the shell (using the T-shell) → command line processing → special characters → command.
C++ / G4MICE Course Session 3 Introduction to Classes Pointers and References Makefiles Standard Template Library.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
Review for Midterm Chapter 1-9 CSc 212 Data Structures.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
1 UNIX essentials (hands-on) the directory tree running programs the shell → command line processing → special characters → command types → shell variables.
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Lecture 3: The parts of a C++ program Professor: Dr. Miguel Alonso Jr. Fall 2008 CGS2423/COP1220.
1 Operating Systems Lecture 2 UNIX and Shell Scripts.
UNIX/LINUX SHELLS.  “A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and.
Introduction to Unix Shell & Scripting with csh/tcsh  Brief Unix History  Unix Shell & Flavor  CSH/TCSH Scripts.
1 A simple C++ program // ======================================================= // File:helloworld.cpp // Author:Vana Doufexi // Date:1/4/2006 // Description:Displays.
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
C++ / G4MICE Course Session 1 - Introduction Edit text files in a UNIX environment. Use the g++ compiler to compile a single C++ file. Understand the C++
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
1 Recall that... char str [ 8 ]; str is the base address of the array. We say str is a pointer because its value is an address. It is a pointer constant.
Configuration your environment Many user-configurable Unix programs (such as your shell) read configuration files when they start up. These configuration.
12. MODULES Rocky K. C. Chang November 6, 2015 (Based on from Charles Dierbach. Introduction to Computer Science Using Python and William F. Punch and.
1 Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Bash Scripting CIRC Summer School 2016 Baowei Liu CIRC Summer School 2016 Baowei Liu.
Chapter 13 Debugging Strategies Learning by debugging.
Lecture 3 Translation.
“Generic Programming” ECE 297
Review 1.
What Is? function predefined, programmer-defined
CIRC Winter Boot Camp 2017 Baowei Liu
Lecture 7 Introduction to Shell Programming
Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
Topic Pre-processor cout To output a message.
ANNOUNCEMENT The missed lecture will be made up this Monday evening in the Tech PC classroom (MG51). A tentative time interval is 6:30-8:00. The exact.
CAP652 Lecture - Shell Programming
LINUX System : Lecture 5 (English-Only Lecture)
Shell Environments.
Writing Shell Scripts ─ part 3
Writing Shell Scripts ─ part 3
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Separate Compilation.
John Carelli, Instructor Kutztown University
Chapter 15 Pointers, Dynamic Data, and Reference Types
Pointers, Dynamic Data, and Reference Types
Memory Allocation CS 217.
Given the code to the left:
Lab 1 Introduction to C++.
Namespaces How Shall I Name Thee?.
Your first C and C++ programs
CPS120: Introduction to Computer Science
Rocky K. C. Chang 15 November 2018 (Based on Dierbach)
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Lab 5: Complex Inputs.
Lecture 2 Fall 2011 September 13-15, 2011 Ghufran Ahmed
Standard Template Library
What Is? function predefined, programmer-defined
Chapter 3 The UNIX Shells
Standard Template Library
An Introduction to STL.
SPL – PS1 Introduction to C++.
CMPSC 60: Week 5 Discussion
Presentation transcript:

Header files (answers to jit-anonymous questions) Angle brackets <> specify header files found in standard locations, double quotes “” specify current directory (or non standard location) <iostream.h>, <ctype.h> “ctimer.h”, “date.h” in new versions of C++, the .h isn’t used for standard C++ classes, e.g., <iostream>, <string>, STL <vector> on our system these files just use #include <iostream.h>, but could pre-compile or otherwise optimize the headers on other system using the .h puts classes into the global namespace, otherwise must qualify use: std::cout vs cout

Standard/STL classes vs libtapestry classes libtapestry strings aren’t as efficient, e.g., no sharing on assignment reference counted, shared storage copy on write always copy (libtapestry) shared vs static libraries static code stored in executable when compiled shared/dynamic linked when program run advantages? string a = “hello”; string b = a; “hello” libtapestry.a a b “hello” standard (libg++.so) “hello” a b b[0] = ‘j’; // what happens?

STL classes (e.g., vector) In general, the STL classes aren’t safe, e.g., bad index not checked on our systems, a “safe” version of classes can be used by using #define __STL_DEBUG before any #include specific differences in STL vector vs libtapestry vector STL libtapestry size() length() push_back() append() append/push_back works differently: size() in libtapestry is number of times append called libtapestry vector, map, stack, queue are as efficient as STL classes (sometimes more efficient) and are safe

Using the system, dot files The shell is the program you type commands at different shells: sh, csh, bash, ksh, tcsh use tcsh unless you’re positive you want something else the shell looks at your PATH environment variable to determine where commands you type are found uses directories specified in left-to-right order setenv PATH /afs/acpub/project/cps/bin:${PATH} also /bin/sh variable called path (lower case) set differently .cshrc file, used each time you start a shell .login file, used when you log in .emacs file, used when you launch emacs/xemacs