Y oung W on Lim 9 /1 /1 7

Similar documents
PA5: Last Hints on Symbol Table: Other Info to Keep

M a p s 2. 0 T h e c o o p era tive w ay t o ke e p m a p s u p t o d a t e. O l iver. Kü h n

T his article is downloaded from

Chapter 1 Introduction to Computers and C++ Programming

Next. Welcome! This guide will get you started down the path to bulk text messaging excellence. Let s start by going over the basics of the system

This guide does not cover every aspect of the WatchManager software and/or setups. Additional online or telephonic support may be required.

2.11 Assignment Operators. Assignment expression abbreviations c = c + 3; can be abbreviated as c += 3; using the addition assignment operator

CSDA Practice Exam Website

second page of program icons in Launchpad the small dot that is fainter in color at the bottom of the display,

Table of Contents. Features... 1 System Requirement... 2 Package Checklist... 2

Applications of Pointers (1A) Young Won Lim 2/27/18

Applications of Pointers (1A) Young Won Lim 3/14/18

Les s on Topics. Les s on Objectives. Student Files Us ed

Applications of Pointers (1A) Young Won Lim 3/21/18

C ITS 1231 Web Tec hnolog ies. JavaScript: Document, Event, Date objects

Applications of Pointers (1A) Young Won Lim 1/5/18

MODEL 528 SERIES DIGITAL COMMUNICATION STATION TABLE OF CONTENTS. Sec tion 1, Soft ware setup Sec tion 2, Hard ware setup...

Transport Drive Kit Installation Guide

Applications of Pointers (1A) Young Won Lim 4/24/18

Pointers (1A) Young Won Lim 12/4/17

SM15K - Interface modules

CD _. _. 'p ~~M CD, CD~~~~V. C ~'* Co ~~~~~~~~~~~~- CD / X. pd.0 & CD. On 0 CDC _ C _- CD C P O ttic 2 _. OCt CD CD (IQ. q"3. 3 > n)1t.

Copyright 2014 Rockwell Automation, Inc. All Rig

Training manual: An introduction to North Time Pro 2019 ESS at the terminal

Ver Install Guide. Ver. 4.3 Install Guide

Designing Baldor's System z SAP solution

The All-in-One, Intelligent NXC Controller

Chapter 3 - Functions

Pointers (1A) Young Won Lim 10/23/17

How a computer runs a program. Binary Representa8on and Opera8ons on Binary Data. Opera8ng System 9/17/13. You can view binary file contents

Department of Computer and Mathematical Sciences

OPERATIONS MANUAL PCM-COM4A

Experiences of Europeans seeking health information in the cyberspace November 2005, Dubrovnik. Ivica Milicevic. Work Research Centre, Dublin

Applications of Pointers (1A) Young Won Lim 3/31/18

Step 1: Get a login. There are two ways to get a login to the MBM Online Community: 1. Send an to requesting a login

Simple Step. Windows Control Manual (SSWin32)

Applications of Pointers (1A) Young Won Lim 4/11/18

(To modify t he installer code, ref er to section [ 1000], Installer Code Programming on page 21) 1234 or

United States Patent (19) Jones et al.

PRELIMINARY SUBJECT TO CHANGE GO SS ACCESS F.M. SH 249 BASELINE CULVERT EXIST ROW A B 2-4 X2 MBC S U E R M D O O EXIT

Instruction Manual BROY LOGMASTER LM750 TABLE OF CONTENTS. 1.0 INTRODUCTION Data Presentation Software...1

MIPS Functions and the Runtime Stack

Ilari Laakso. Writing These Poems. Settings of three poems by Chrys Salt. for female voice and piano

Pointers (1A) Young Won Lim 10/18/17

Control Structures (Deitel chapter 4,5)

S5-115U. Application

The Lincoln National Life Insurance Company Universal Life Portfolio

Case Study: Meta Classes

CSharp. Microsoft. UPGRADE-MCAD Skills to MCPD Dvlpr by Using the MS.NET Frmwk

Windmill 750 Manual. Windmill Software Limited

Prices exclude Freight and GST Page 1 of 9. Range Group Image (not to scale) Part Number Description Retail

Pointers (1A) Young Won Lim 1/9/18

Pointers (1A) Young Won Lim 1/5/18

So il Geochem ica l Ba seline and Env ironm en ta l Background Va lues of Agr icultura l Reg ion s in Zhejiang Prov ince.

JTAG 1 3 VCC 5 STOPCLK# 7 TCK 9 TDI 11 TMS GND 10 GND 12 TDO JTAG_2X6. Outputs. Da ta Buffe r 20 VCC BD0 BD1 BD2 BD3

H&B LDU 69.1 Loadcell Digitizing Unit

CSharp. Microsoft. UPGRADE- MCAD Skills to MCTS Web Apps Using MS.NET Frwrk

AMD and OpenCL. Mike Houst on Senior Syst em Archit ect Advanced Micro Devices, I nc.

Setting Up read&write for ipad

Descriptive Statistics (Part 2)

Introduction to Programming

Intermediate Programming, Spring 2017*

COMPUTER BASICS. Operating System

LoGA: Low-Overhead GPU Accounting Using Events

Overview (1A) Young Won Lim 9/14/17

FEATURES DESCRIPTION CONFIGURING. keyed and locking pin and receptacle.

Bottom's Gonna Be on Top

USB 500 EXT-USB-500 USER'S MANUAL.

RAM (1A) Young Won Lim 11/12/13

Overview (1A) Young Won Lim 9/9/17

Administering a SQL Database Infrastructure

Chapter 4: Application Protocols 4.1: Layer : Internet Phonebook : DNS 4.3: The WWW and s

Overview (1A) Young Won Lim 9/25/17

Corel Smart Graphics Studio. Creating a sample XML file

A New Method of Using Polytomous Independent Variables with Many Levels for the Binary Outcome of Big Data Analysis

EASTER VIGIL: EUCHARISTIC PRAYER 2

TMCH Report March February 2017

WORD PRO CESS ING (MS-WORD) ( The ory ) (327) Can di date must write his/her Roll Num ber on the first page of the question paper.

Memory Arrays (4H) Gate Level Design. Young Won Lim 3/15/16

The Outlook for U.S. Manufacturing

Metalogix Expert. Scenario Based Install Jumpstart. March,

Panelists. Patrick Michael. Darryl M. Bloodworth. Michael J. Zylstra. James C. Green

GPM-6 MANUAL. GENERAL MODE OPERATING PROCEDURES Volta ge & Current FRONT PANEL & KEY FUNCTIONS. Key Name. Symbol. Descriptions

Adobe Acrobat Pro DC - Common Accessibility Issues

S5-115U. Application

CSharp. Microsoft. UPGRADE-MCAD Skills to MCPD Wdws Dvlpr by Using MS.NET Frmwk

AIX, AppleTalk Services, and the Network Server. Quick Reference Card

Marketing 'Go-To' Guide. for I-CAR Volunteers & Instructors

Pointers (1A) Young Won Lim 11/1/17

CAT EXT-CAT USER MANUAL.

Fall 2007, Final Exam, Data Structures and Algorithms

Lecture A2: X-TOY Programming

Telecommunications and Internet Access By Schools & School Districts

God, My Savior. Assembly, Cantor, SAB Choir, Keyboard, and Guitar. Dan Schutte Melody adapted from Salve Mater Misericordiae. Œ œ.

Connectors, adapters, and tools

ESET REMOTE ADMINISTRATOR Event Management Extension Technical Setup and User Guide. Click here to download the latest version of this document

T his article is downloaded from

OPERATIONS MANUAL PCM-ESCC

Dimensional Data - Output Unit, Enclosure, and Cable Connector

Forthcoming Close Approaches To The Earth

Transcription:

Overview (1 A)

Cop y rig h t (c) 2 0 0 9-2 0 1 7 Y oung W. Lim. Perm ission is g ra nted to cop y, d istribute a nd /or m od ify th is d ocum ent und er th e term s of th e G N UFree D ocum enta tion License, Version 1.2 or a ny la ter version p ublish ed by th e Free Softw a re Found a tion;w ith no Inva ria nt Sections, no Front-Cover Texts, a nd no Ba ck-cover Texts. A cop y of th e license is includ ed in th e section entitled "G N U Free D ocum enta tion License". Plea se send corrections (or sug g estions)to y oung w lim @ h otm a il.com. Th is d ocum ent w a s p rod uced by using Op enoffi ce.

Ca lcula ting th e Mea n m = a b c 3 40 + 50 + 60 3 = 150 3 = 50 Integ er num ber fi xed p oint num ber 45 53 63 3 = 161 3 = 53.6666666... Rea lnum ber fl oa ting p oint num ber Overview 3

Ca lcula ting a m ea n in C int a, b, c; int m ea n; a = 4 0 ; b = 5 0 ; c = 6 0 ; m ea n = (a + b + c)/ 3 ; int a, b, c; fl oa t m ea n; a = 4 5 ; b = 5 3 ; c = 6 3 ; m ea n = (a + b + c)/ 3.0 ; * Va ria ble * Ty p e * Assig nm ent * Op era tor Overview 4

Va ria bles int Ty p e int a, b, c; int m ea n; a = 4 0 ; b = 5 0 ; c = 6 0 ; m ea n = (a + b + c)/ 3 ; a b c m ea n a b c m ea n 4 0 5 0 6 0 5 0 Overview 5

Va ria bles fl oa t Ty p e int a, b, c; fl oa t m ea n; a = 4 5 ; b = 5 3 ; c = 6 3 ; m ea n = (a + b + c)/ 3.0 ; a b c m ea n a b c m ea n 4 5 5 3 6 3 5 3.6...6 7 fl oa t ty p e Overview 6

C a nd Assem bly Cod e View va ria ble na m e a va ria ble va lue 4 0 a d d ress d a ta b c m ea n 5 0 6 0 5 0 c source cod e Com p iler 4 5 0 0 4 5 1 0 4 5 2 0 4 5 3 0 a ssem bly cod e 4 0 5 0 6 0 5 0 Overview 7

Mem ory :(Ad d ress, D a ta ) a a d d ress a d d ress d a ta a va lue b a d d ress 4 5 0 0 4 0 b va lue c a d d ress m ea n a d d ress 4 5 1 0 5 0 c va lue m ea n va lue 4 5 2 0 6 0 4 5 3 0 5 0 com p iler d eterm ines th e a d d resses Overview 8

Ad d resses of va ria bles :com p iler d eterm ined a d d ress a d d ress of a d d ress of a d d ress of a d d ress of Overview 9

Exa m p le a d d ress a nd d a ta of a va ria ble a d d ress 4 5 0 0 4 0 & a a 4 5 0 0 4 0 :a d d ress ( ) :d a ta ( ) Abstra ct Rep resenta tion & a a Overview 1 0

Mem ory a nd th e & op era tor a d d ress a 4 0 a d d ress va lue b 5 0 4 5 0 0 4 0 c m ea n 6 0 5 0 4 5 1 0 4 5 2 0 5 0 6 0 4 5 3 0 5 0 Overview 1 1

A va ria ble ca n h old a n a d d ress a = 4 0 ; Va lue a ssig nm ent to a int a ; 4 5 0 0 = 4 0 & a a 4 5 0 0 4 0 :a d d ress ( ) :d a ta ( ) p = & a ; Ad d ress a ssig nm ent to p int * p ; G enera labstra ct Rep resenta tion = & a Overview 1 2

D a ta a t a n a d d ress a d d ress d a ta a d d ress of d a ta a t th e a d d ress of a d d ress of d a ta a t th e a d d ress of a d d ress of d a ta a t th e a d d ress of a d d ress of d a ta a t th e a d d ress of Overview 1 3

Th e & a nd * op era tors [int a ;] T h e a d d r e s s o f a v a r i a b l e : A d d r e s s o f o p e r a t o r & t h e v a l u e a t a n a d d r e s s : D e r e f e r e n c i n g o p e r a t o r * * & a a & a a & Overview 1 4

Th e & a nd * op era tors [int * p ;] T h e a d d r e s s o f a v a r i a b l e : A d d r e s s o f o p e r a t o r & t h e v a l u e a t a n a d d r e s s : D e r e f e r e n c i n g o p e r a t o r * * & p p & p p & & (p )= & p * (& p )= p * p * p p * p & & (* p )= p * (p )= * p va lue of p ( ) Overview 1 5

Th e & a nd * ca ncelea ch oth er & (* p )= p * (& p )= p [2 ] * & p p & p p * (& p )= p [1 ] & [1 ] * p * p & (* p )= p p * p [2 ] & Overview 1 6

Pointer Ty p e D ecla ra tion int a ; a h old s integ er & a a int * p ; p h old s * p h old s integ er & p va lue of p ( ) p p * p Overview 1 7

Ad d ress Assig nm ent w ith a Pointer Va ria ble int * p ; a d d ress va lue p = & a ; : a d d r of p : va lue of p :& a (a d d r of a ) 4 5 0 0 4 5 1 0 4 5 2 0 4 0 5 0 6 0 4 5 3 0 5 0 4 5 4 0 Overview 1 8

Va lue Assig nm ent w ith a Pointer Va ria ble int * p ; a d d ress va lue p = & a ; * p = 5 5 ; : a d d r of p : va lue of p :& a (a d d r of a ) : p p oints to ( va lue of p ) : va lue 5 5 4 5 0 0 4 5 1 0 4 5 2 0 4 5 3 0 5 0 6 0 5 0 4 5 4 0 4 5 0 0 Overview 1 9

p rintf():th e built-in function Exp ected Outp ut p rintf( Th e m ea n of th ree num bers \n ); p rintf( a = % d \n, a ); p rintf( b = % d \n, b); p rintf( c = % d \n, c); p rintf( m ea n (% d, % d, % d )= > % d \n, a, b, c, m ea n); Overview 2 0

sca nf():a noth er built-in function Inp ut Exa m p le a d d ress va lue 4 5 0 0 4 0 4 5 1 0 5 0 4 5 2 0 6 0 p rintf( Enter th ree num bers! \n ); p rintf( a = ); ( % d, ); p rintf( b = ); ( % d, ); p rintf( c = ); ( % d, ); Overview 2 1

Th e Ma in Function (1 ) { (void ) int a, b, c; int m ea n; a = 4 0 ; b = 5 0 ; c = 6 0 ; m ea n = (a + b + c)/ 3 ; p rintf( Th e m ea n of th ree num bers \n ); p rintf( a = % d \n, a ); p rintf( b = % d \n, b); p rintf( c = % d \n, c); p rintf( m ea n (% d, % d, % d )= > % d \n, a, b, c, m ea n); } Overview 2 2

Th e Ma in Function (2 ) { (void ) int a, b, c; int m ea n; p rintf( Enter th ree num bers! \n ); p rintf( a = ); ( % d, ); p rintf( b = ); ( % d, ); p rintf( c = ); ( % d, ); m ea n = (a + b + c)/ 3 ; p rintf( Th e m ea n of th ree num bers \n ); p rintf( a = % d \n b = % d \n c = % d \n, a, b, c); p rintf( m ea n (% d, % d, % d )= > % d \n, a, b, c, m ea n ); } Overview 2 3

Th e Ma in Function (3 ) { (void ) int a, b, c; int m ea n; g et_num bers(? ); com p ute_m ea n(? ); p rint_num bers(? ); } Overview 2 4

Function com p ute_m ea n() com p ute_m ea n (int, int, int ); m a in (void ) { int m ea n; * Ca llby Va lue m ea n = com p ute_m ea n(4 0, 5 0, 6 0 ); } { int va lues a re cop ied com p ute_m ea n (int, int, int ) int a vg ; a vg = ( + + )/ 3 ; return( a vg ); * Loca lva ria ble } * Return Va lue Overview 2 5

Function g et_num bers() g et_num bers (int *, int *, int * ); m a in (void ) { int a, b, c; * Ca llby Reference g et_num bers(& a, & b, & c); } a d d resses a re cop ied { } g et_num bers (int *, int *, int * ) p rintf( Enter th ree num bers! \n ); p rintf( a = ); ( % d, ); p rintf( b = ); ( % d, ); p rintf( c = ); ( % d, ); * N o Return Va lue Overview 2 6

Ca llby Va lue & Ca llby Reference * Ca llby Va lue m ea n = com p ute_m ea n(4 0, 5 0, 6 0 ); 4 0 5 0 6 0 com p ute_m ea n (int, int, int ) & x x= 4 0 & y y = 5 0 & z z = 6 0 * Ca llby Reference g et_num bers(& a, & b, & c); & a 4 0 & b 5 0 & c 6 0 g et_num bers (int *, int *, int * ) & x x= & a & y y = & b & z z = & c Overview 2 7

Ch a ng e th e ca ller s va ria bles * Ca llby Reference a d d ress va lue & a 4 0 & b 5 0 & c 6 0 Ca ller s Va ria bles & x x= & a & y y = & b & z z = & c N ow, va lues of a, b, c a re ch a ng ed in th e g et_num bers()function * x= 1 0 0 ; * y = 2 0 0 ; * z = 3 0 0 ; a = 1 0 0 ; b= 2 0 0 ; c= 3 0 0 ; Th e ca llee ca n ch a ng e th e va lues of th e ca ller s va ria bles & a 1 0 0 & b 2 0 0 & c 3 0 0 Overview 2 8

Function p rint_num bers() { } p rint_num bers (int, int, int, int ) p rintf( Th e m ea n of th ree num bers \n ); p rintf( a = % d \n b = % d \n c = % d \n, x, y, z ); p rintf( m ea n (% d, % d, % d )= > % d \n, x, y, z, a vg ); * N o Return Va lue * Ca llby Va lue m a in (void ) { int a, b, c; int m ea n; } p rint_num bers(a, b, c, m ea n); Overview 2 9

Th e Ma in Function (4 ) g et_num bers (int *, int *, int * ); com p ute_m ea n (int, int, int ); p rint_num bers (int, int, int, int ); Prototy p es m a in (void ) { int a, b, c; int m ea n; g et_num bers(& a, & b, & c); m ea n = com p ute_m ea n(a, b, c); } p rint_num bers(a, b, c, m ea n); Overview 3 0

Th e Ma in Pa ra m eters (1 ) #includ e < std io.h > int m a in(int a rg c, ch a r * a rg v[]) { } int i; p rintf("a rg c= % d \n", a rg c); for (i= 0 ;i< a rg c;+ + i){ p rintf("a rg v[% d ] = % s \n", i, a rg v[i]); } Overview 3 1

Th e Ma in Pa ra m eters (2 ) y oung @ usy s ~ $ a rg c= 1 a rg v[0 ] =./a.out y oung @ usy s ~ $ a rg c= 4 a rg v[0 ] =./a.out a rg v[1 ] = one a rg v[2 ] = tw o a rg v[3 ] = th ree y oung @ usy s ~ $ a rg c= 5 a rg v[0 ] =./a.out a rg v[1 ] = one a rg v[2 ] = tw o a rg v[3 ] = th ree a rg v[4 ] = four Overview 3 2

Th e Ma in Pa ra m eters (3 ) y oung @ usy s ~ $ a rg c= 3 a rg v[0 ] =./a.out a rg v[1 ] = one a rg v[2 ] = tw o a rg v[0 ] a rg v[1 ] a rg v[2 ] a rg v[3 ] \0 \0 \0 Overview 3 3

[1 ] Essentia lc, N ickpa rla nte [2 ] Effi cient C Prog ra m m ing, Ma rka. W eiss [3 ] C A Reference Ma nua l, Sa m uelp. H a rbison & G uy L. Steele Jr. [4 ] C La ng ua g e Exp ress, I. K. Ch un