Programming in ANSI C

Total Page:16

File Type:pdf, Size:1020Kb

Programming in ANSI C Loughborough University Institutional Repository Programming in ANSI C This item was submitted to Loughborough University's Institutional Repository by the/an author. Citation: DAWSON, R., 2001. Programming in ANSI C. Third Edition. Loughborough: Group D Publications Ltd. Additional Information: • This is a book. Metadata Record: https://dspace.lboro.ac.uk/2134/10054 Version: Published Publisher: Group D Publications Ltd. Please cite the published version. This item was submitted to Loughborough’s Institutional Repository (https://dspace.lboro.ac.uk/) by the author and is made available under the following Creative Commons Licence conditions. For the full text of this licence, please go to: http://creativecommons.org/licenses/by-nc-nd/2.5/ Programming in ANSI C Third Edition Ray Dawson Group D Publications 2 Programming in ANSI C This is an online copy of a book published by Group D Publications Ltd. Apart from this page it is an identical copy of the third edition of “Programming in ANSI C” by Ray Dawson All rights reserved. This online version of the book is provided for personal and educational use only. No part of this book may be reproduced in any form, by photostat, microfilm, retrieval system, or by any other means, without the prior permission of the publisher except in the case of duplication by professional educators for use by their students. Copies of this online version cannot be duplicated and sold for profit by any organisation. Copyright © 2006 by Ray Dawson, Loughborough University. First edition published 1993 (ISBN 1-874152-02-0) Second revised and enlarged edition published 1996 (ISBN 1-874152-03-9) Third edition published in 2001 (ISBN 1-874152-10-1) British Library Cataloguing-in-Publication data A catalogue record for this book is available from the British Library Unix™ is a trademark of AT&T Bell Laboratories DEC™ is a trademark of Digital Equipment Corporation Hard copies of this book should be ordered from the author: Ray Dawson Department of Computer Studies Loughborough University Loughborough, Leicestershire LE11 3TU Telephone: 01509-222679 Fax: 01509-211586 Email: [email protected] Preamble 3 Preamble This third addition of this book has been published by popular demand. I am very pleased by the way the book has been received by students, members of the teaching staff, and by software professionals in industry. On the whole the "no nonsense" approach of getting to the point without introducing hundreds of pages of basic information on how to program has been well received. Only two serious criticisms have been made about the first edition and these have been tackled in later editions. Firstly, some lecturers and some students complained there were no exercises in the book and secondly, some also complained there were not enough examples of C code. By including a set of exercises and a set of sample solutions I believe I have satisfied both requests together. Other improvements are relatively minor, an odd correction here, an odd expanded explanation there, but I believe the net result will be an even better book for students, teachers and software professionals alike. The only difference between the second and third edition is in the binding - this new edition should prove more robust. Acknowledgements I would like to thank Group D Publications for publishing this book. My thanks also go to the Department of Computer Studies, and in particular, Professor Jim Alty, for providing the money and resources to enable this book to be published. Finally I must thank my colleague, Satish Bedi, for his helpful comments on the first edition of this book, and for bringing to my attention the corrections required - he has made a significant contribution towards the improved accuracy of this edition. Dedication I would like thank my wife, Dawn, and my sons, Matthew and Alex, for their support while I was producing this book. I dedicate this book to them. Ray Dawson 4 Programming in ANSI C Contents Part A: The C Language Pages 6-123 Section 1 : Introduction and Overview 12 Section 2 : Constants and Variables 15 Section 3 : Assignments and Expressions 22 Section 4 : Introduction to Simple Input and Output Statements 35 Section 5 : Arrays 40 Section 6 : Conditional Statements 48 Section 7 : Other Control Flow Statements 56 Section 8 : Structures and Unions 63 Section 9 : Introduction to Functions 73 Section 10 : Pointers 92 Section 11 : Storage Classes 106 Section 12 : Input and Output To Files 112 Section 13 : Other C Features 116 Appendix A : Operator Precedence Table 123 Part B: The C Pre-processor Pages 124-135 Section 1 : The 'C' Pre-processor 126 Part C: The Standard C Library Pages 136-173 Section 1 : Introduction to the Standard 'C' Library 141 Section 2 : Output From The Terminal 142 Section 3 : Input From The Terminal 145 Section 4 : Formatted Conversion In Memory 149 Section 5 : File Access Using File Pointers 151 Section 6 : File I/O Functions 153 Section 7 : File Access Using File Descriptor Numbers 160 Section 8 : String Functions 162 Section 9 : Character Functions 164 Section 10 : Mathematical Functions 166 Section 11 : Memory Allocation Functions 168 Section 12 : System Functions 170 Contents 5 Part D: C Program Accuracy and Style Pages 174-203 Section 1 : Run Time Error Check List for C Programs 176 Section 2 : Quality Check List for C Programs 189 Part E: Sample Solutions to the Exercises Pages 204-252 Section 1 : Sample Solutions to C Exercise 1 207 Section 2 : Sample Solutions to C Exercise 2 208 Section 3 : Sample Solutions to C Exercise 3 211 Section 4 : Sample Solutions to C Exercise 4 213 Section 5 : Sample Solutions to C Exercise 5 215 Section 6 : Sample Solutions to C Exercise 6 218 Section 7 : Sample Solutions to C Exercise 7 220 Section 8 : Sample Solutions to C Exercise 8 222 Section 9 : Sample Solutions to C Exercise 9 224 Section 10 : Sample Solutions to C Exercise 10 228 Section 11 : Sample Solutions to C Exercise 11 234 Section 12 : Sample Solutions to C Exercise 12 238 Section 13 : Sample Solutions to C Exercise 13 242 Section 14 : Sample Solutions to C Pre-processor Exercise 247 Index Pages 253-256 Part A : The C Programming Language 6 Programming in ANSI Third Edition PART A The C Language Part A : The C Programming Language 7 Part A : Contents Page Section 1 : Introduction and Overview 12 1.1 'C' History and Background 12 1.2 Example 'C' Program 13 1.3 C Program Structure 13 1.4 C Exercise 1 14 Section 2 : Constants and Variables 15 2.1 Declaring Data Variables 15 2.2 Notes on Variable Types 15 2.3 The Format of Variable Declarations 16 2.4 Where Variables are Declared 17 2.5 Number Constants 18 2.6 Character Constants 18 2.7 Character Constants and String Constants 19 2.8 Initialisation of Variables 20 2.9 "Constant" Variables and the const Qualifier 20 2.10 C Exercise 2 21 Section 3 : Assignments and Expressions 22 3.1 Simple Assignment Statements 22 3.2 Arithmetic Operators 22 3.3 Notes on Arithmetic Operators 23 3.4 Dividing Integers 23 3.5 Shift Operators 24 3.6 The Bitwise Operators: ~ & | and ^ 25 3.7 The ~ Operator 25 3.8 The & Operator 25 3.9 The | Operator 26 3.10 The ^ Operator 26 3.11 Mixing Variable Types 26 3.12 The C Handling of char and short Variables 27 3.13 Converting int Variables to char And short 27 3.14 Mixtures of Variable Types in Expressions 28 3.15 Mixed Variable Type Assignments 29 3.16 Assigning Negative Values to Unsigned Variables 29 3.17 Warning! There Are NO Warnings! 30 3.18 Casts 30 3.19 Different Assignment Operators 31 3.20 Embedded Statements 31 3.21 Using Embedded Statements 32 3.22 Embedded ++ and -- Operators 32 3.23 C Exercise 3 33 Part A : The C Programming Language 8 Page Section 4 : Introduction to Simple Input and Output Statements 35 4.1 Introduction to Input and Output 35 4.2 The getchar() Function 35 4.3 putchar(character) 36 4.4 printf(format,values); 37 4.5 printf Substitution Types 37 4.6 printf Substitution Modifiers 38 4.7 C Exercise 4 39 Section 5 : Arrays 40 5.1 Arrays 40 5.2 Limitations and Dangers in the Use of an Array 40 5.3 Strings 41 5.4 The gets(chararray) Function for Reading Strings 42 5.5 Initialisation of Arrays 42 5.6 Two Dimensional Arrays 43 5.7 Arrays of Arrays 43 5.8 Using Individual Rows 44 5.9 Array Syntax Warning! 44 5.10 Multi Dimensional Arrays 44 5.11 Initialising Multi Dimensional Arrays 45 5.12 C Exercise 5 46 Section 6 : Conditional Statements 48 6.1 The if Statement 48 6.2 Logical (Boolean) Variables 48 6.3 Confusion of = and == 49 6.4 The && and || operators 49 6.5 Common Errors of Multiple Conditions 50 6.6 Confusion of && and || with & and | 51 6.7 Evaluation of Multiple Conditions 51 6.8 The ! Operator 52 6.9 The else Statement 52 6.10 Grouping Statements With {} 52 6.11 Layout of {} Blocks and Code 53 6.12 if (...) if (...) Statements 54 6.13 if ... else if ... else Construction 54 6.14 The ?: Operator Pair 55 6.15 C Exercise 6 55 Part A : The C Programming Language 9 Page Section 7 : Other Control Flow Statements 56 7.1 The while Statement 56 7.2 The do .. while Statement 57 7.3 The switch Statement 57 7.4 The for Statement 59 7.5 The break and continue Statements 60 7.6 The Comma Operator 60 7.7 The goto Statement 61 7.8 C Exercise 7 62 Section 8 : Structures and Unions 63 8.1 What is a Structure? 63 8.2 Structure Type Declarations 63 8.3 Structure Declarations 64 8.4 Referencing Structure Members 65 8.5 Referencing Whole Structures 65 8.6 Initialisation of Structures 66 8.7 Structure Bit Fields 66 8.8 Using Structure Bit Fields 67 8.9 Unions 68 8.10 Union Declaration 68 8.11 Referencing Whole Unions 69 8.12 Why Use a Union? 69 8.13 Nesting Structures and Unions 70 8.14 Initialising Unions 71 8.15 sizeof 71 8.16 C Exercise 8 72 Section 9 : Introduction to Functions 73 9.1 What is a Function? 73 9.2 Why Use a Function? 73 9.3 Function Call, Definition and Declaration 73 9.4 A Simple Function Example 74 9.5 Notes On Using Functions 75 9.6 Local Variables 76 9.7 Global Variables 77 9.8 Local Variables in Different Functions 78 9.9 Global and Local Variables of the Same Name 79 9.10 Function Parameters 80 9.11 Notes on Function Parameters 80 9.12 Function Parameter Limitations 81 9.13 Notes on the Function Prototype 82 9.14 The Use of the Elipses ..
Recommended publications
  • Modern Programming Languages CS508 Virtual University of Pakistan
    Modern Programming Languages (CS508) VU Modern Programming Languages CS508 Virtual University of Pakistan Leaders in Education Technology 1 © Copyright Virtual University of Pakistan Modern Programming Languages (CS508) VU TABLE of CONTENTS Course Objectives...........................................................................................................................4 Introduction and Historical Background (Lecture 1-8)..............................................................5 Language Evaluation Criterion.....................................................................................................6 Language Evaluation Criterion...................................................................................................15 An Introduction to SNOBOL (Lecture 9-12).............................................................................32 Ada Programming Language: An Introduction (Lecture 13-17).............................................45 LISP Programming Language: An Introduction (Lecture 18-21)...........................................63 PROLOG - Programming in Logic (Lecture 22-26) .................................................................77 Java Programming Language (Lecture 27-30)..........................................................................92 C# Programming Language (Lecture 31-34) ...........................................................................111 PHP – Personal Home Page PHP: Hypertext Preprocessor (Lecture 35-37)........................129 Modern Programming Languages-JavaScript
    [Show full text]
  • About ILE C/C++ Compiler Reference
    IBM i 7.3 Programming IBM Rational Development Studio for i ILE C/C++ Compiler Reference IBM SC09-4816-07 Note Before using this information and the product it supports, read the information in “Notices” on page 121. This edition applies to IBM® Rational® Development Studio for i (product number 5770-WDS) and to all subsequent releases and modifications until otherwise indicated in new editions. This version does not run on all reduced instruction set computer (RISC) models nor does it run on CISC models. This document may contain references to Licensed Internal Code. Licensed Internal Code is Machine Code and is licensed to you under the terms of the IBM License Agreement for Machine Code. © Copyright International Business Machines Corporation 1993, 2015. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents ILE C/C++ Compiler Reference............................................................................... 1 What is new for IBM i 7.3.............................................................................................................................3 PDF file for ILE C/C++ Compiler Reference.................................................................................................5 About ILE C/C++ Compiler Reference......................................................................................................... 7 Prerequisite and Related Information..................................................................................................
    [Show full text]
  • Technical Study Desktop Internationalization
    Technical Study Desktop Internationalization NIC CH A E L T S T U D Y [This page intentionally left blank] X/Open Technical Study Desktop Internationalisation X/Open Company Ltd. December 1995, X/Open Company Limited All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the copyright owners. X/Open Technical Study Desktop Internationalisation X/Open Document Number: E501 Published by X/Open Company Ltd., U.K. Any comments relating to the material contained in this document may be submitted to X/Open at: X/Open Company Limited Apex Plaza Forbury Road Reading Berkshire, RG1 1AX United Kingdom or by Electronic Mail to: [email protected] ii X/Open Technical Study (1995) Contents Chapter 1 Internationalisation.............................................................................. 1 1.1 Introduction ................................................................................................. 1 1.2 Character Sets and Encodings.................................................................. 2 1.3 The C Programming Language................................................................ 5 1.4 Internationalisation Support in POSIX .................................................. 6 1.5 Internationalisation Support in the X/Open CAE............................... 7 1.5.1 XPG4 Facilities.........................................................................................
    [Show full text]
  • Unix Standardization and Implementation
    Contents 1. Preface/Introduction 2. Standardization and Implementation 3. File I/O 4. Standard I/O Library 5. Files and Directories 6. System Data Files and Information 7. Environment of a Unix Process 8. Process Control 9. Signals 10.Inter-process Communication * All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003. Standardization and Implementation Why Standardization? Proliferation of UNIX versions What should be done? The specifications of limits that each implementation must define! * All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003. 1 UNIX Standardization ANSI C American National Standards Institute ISO/IEC 9899:1990 International Organization for Standardization (ISO) Syntax/Semantics of C, a standard library Purpose: Provide portability of conforming C programs to a wide variety of OS’s. 15 areas: Fig 2.1 – Page 27 * All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003. UNIX Standardization ANSIC C <assert.h> - verify program assertion <ctype.h> - char types <errno.h> - error codes <float.h> - float point constants <limits.h> - implementation constants <locale.h> - locale catalogs <math.h> - mathematical constants <setjmp.h> - nonlocal goto <signal.h> - signals <stdarg.h> - variable argument lists <stddef.h> - standard definitions <stdio.h> - standard library <stdlib.h> - utilities functions <string.h> - string operations <time.h> - time and date * All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003. 2 UNIX Standardization POSIX.1 (Portable Operating System Interface) developed by IEEE Not restricted for Unix-like systems and no distinction for system calls and library functions Originally IEEE Standard 1003.1-1988 1003.2: shells and utilities, 1003.7: system administrator, > 15 other communities Published as IEEE std 1003.1-1990, ISO/IEC9945-1:1990 New: the inclusion of symbolic links No superuser notion * All rights reserved, Tei-Wei Kuo, National Taiwan University, 2003.
    [Show full text]
  • Lecture Notes on Types for Part II of the Computer Science Tripos
    Q Lecture Notes on Types for Part II of the Computer Science Tripos Prof. Andrew M. Pitts University of Cambridge Computer Laboratory c 2016 A. M. Pitts Contents Learning Guide i 1 Introduction 1 2 ML Polymorphism 6 2.1 Mini-ML type system . 6 2.2 Examples of type inference, by hand . 14 2.3 Principal type schemes . 16 2.4 A type inference algorithm . 18 3 Polymorphic Reference Types 25 3.1 The problem . 25 3.2 Restoring type soundness . 30 4 Polymorphic Lambda Calculus 33 4.1 From type schemes to polymorphic types . 33 4.2 The Polymorphic Lambda Calculus (PLC) type system . 37 4.3 PLC type inference . 42 4.4 Datatypes in PLC . 43 4.5 Existential types . 50 5 Dependent Types 53 5.1 Dependent functions . 53 5.2 Pure Type Systems . 57 5.3 System Fw .............................................. 63 6 Propositions as Types 67 6.1 Intuitionistic logics . 67 6.2 Curry-Howard correspondence . 69 6.3 Calculus of Constructions, lC ................................... 73 6.4 Inductive types . 76 7 Further Topics 81 References 84 Learning Guide These notes and slides are designed to accompany 12 lectures on type systems for Part II of the Cambridge University Computer Science Tripos. The course builds on the techniques intro- duced in the Part IB course on Semantics of Programming Languages for specifying type systems for programming languages and reasoning about their properties. The emphasis here is on type systems for functional languages and their connection to constructive logic. We pay par- ticular attention to the notion of parametric polymorphism (also known as generics), both because it has proven useful in practice and because its theory is quite subtle.
    [Show full text]
  • Open C++ Tutorial∗
    Open C++ Tutorial∗ Shigeru Chiba Institute of Information Science and Electronics University of Tsukuba [email protected] Copyright c 1998 by Shigeru Chiba. All Rights Reserved. 1 Introduction OpenC++ is an extensible language based on C++. The extended features of OpenC++ are specified by a meta-level program given at compile time. For dis- tinction, regular programs written in OpenC++ are called base-level programs. If no meta-level program is given, OpenC++ is identical to regular C++. The meta-level program extends OpenC++ through the interface called the OpenC++ MOP. The OpenC++ compiler consists of three stages: preprocessor, source-to-source translator from OpenC++ to C++, and the back-end C++ com- piler. The OpenC++ MOP is an interface to control the translator at the second stage. It allows to specify how an extended feature of OpenC++ is translated into regular C++ code. An extended feature of OpenC++ is supplied as an add-on software for the compiler. The add-on software consists of not only the meta-level program but also runtime support code. The runtime support code provides classes and functions used by the base-level program translated into C++. The base-level program in OpenC++ is first translated into C++ according to the meta-level program. Then it is linked with the runtime support code to be executable code. This flow is illustrated by Figure 1. The meta-level program is also written in OpenC++ since OpenC++ is a self- reflective language. It defines new metaobjects to control source-to-source transla- tion. The metaobjects are the meta-level representation of the base-level program and they perform the translation.
    [Show full text]
  • Let's Get Functional
    5 LET’S GET FUNCTIONAL I’ve mentioned several times that F# is a functional language, but as you’ve learned from previous chapters you can build rich applications in F# without using any functional techniques. Does that mean that F# isn’t really a functional language? No. F# is a general-purpose, multi paradigm language that allows you to program in the style most suited to your task. It is considered a functional-first lan- guage, meaning that its constructs encourage a functional style. In other words, when developing in F# you should favor functional approaches whenever possible and switch to other styles as appropriate. In this chapter, we’ll see what functional programming really is and how functions in F# differ from those in other languages. Once we’ve estab- lished that foundation, we’ll explore several data types commonly used with functional programming and take a brief side trip into lazy evaluation. The Book of F# © 2014 by Dave Fancher What Is Functional Programming? Functional programming takes a fundamentally different approach toward developing software than object-oriented programming. While object-oriented programming is primarily concerned with managing an ever-changing system state, functional programming emphasizes immutability and the application of deterministic functions. This difference drastically changes the way you build software, because in object-oriented programming you’re mostly concerned with defining classes (or structs), whereas in functional programming your focus is on defining functions with particular emphasis on their input and output. F# is an impure functional language where data is immutable by default, though you can still define mutable data or cause other side effects in your functions.
    [Show full text]
  • User's Manual
    rBOX610 Linux Software User’s Manual Disclaimers This manual has been carefully checked and believed to contain accurate information. Axiomtek Co., Ltd. assumes no responsibility for any infringements of patents or any third party’s rights, and any liability arising from such use. Axiomtek does not warrant or assume any legal liability or responsibility for the accuracy, completeness or usefulness of any information in this document. Axiomtek does not make any commitment to update the information in this manual. Axiomtek reserves the right to change or revise this document and/or product at any time without notice. No part of this document may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Axiomtek Co., Ltd. Trademarks Acknowledgments Axiomtek is a trademark of Axiomtek Co., Ltd. ® Windows is a trademark of Microsoft Corporation. Other brand names and trademarks are the properties and registered brands of their respective owners. Copyright 2014 Axiomtek Co., Ltd. All Rights Reserved February 2014, Version A2 Printed in Taiwan ii Table of Contents Disclaimers ..................................................................................................... ii Chapter 1 Introduction ............................................. 1 1.1 Specifications ...................................................................................... 2 Chapter 2 Getting Started ......................................
    [Show full text]
  • LTIB Quick Start: Targeting the Coldfire Mcf54418tower Board By: Soledad Godinez and Jaime Hueso Guadalajara Mexico
    Freescale Semiconductor Document Number: AN4426 Application Note Rev. 0, December 2011 LTIB Quick Start: Targeting the ColdFire MCF54418Tower Board by: Soledad Godinez and Jaime Hueso Guadalajara Mexico Contents 1 Introduction 1 Introduction................................................................1 The purpose of this document is to indicate step-by-step how 2 LTIB..........................................................................1 to accomplish these tasks: • Install the BSP on a host development system. 2.1 Introduction....................................................1 • Run Linux Target Image Builder (LTIB) to build target 2.2 Installing the BSP...........................................2 images. • Boot Linux on the ColdFire MCF54418 Tower board. 2.3 Running LTIB................................................7 3 Target deployment .................................................13 This document is a guide for people who want to properly set up the Freescale Linux Target Image Builder (LTIB) for the 3.1 The Tower kit ..............................................13 ColdFire MCF54418 Tower Board Support Package (BSP). 3.2 Constructing the Tower kit...........................15 3.3 Programming U-boot, kernel, and root file system.............................................16 2 LTIB 3.4 Configuring U-boot......................................24 3.5 Running.......................................................25 4 Conclusions.............................................................26 2.1 Introduction Freescale GNU/Linux
    [Show full text]
  • ESC 151 –C Programming (ANSI C) Note on Medical Reasons For
    ESC 151 –C Programming (ANSI C) Class: Section 1: Remote, quizzes Monday at 9:30 Section 2: TTH 10:00 AM-11:15 AM Suggested External Information (in place of a book): http://www.cprogramming.com/tutorial/c- tutorial.html Instructor: Robert Fiske Office: FH 315, Office Hours/Availability: Officially: TTH 6:00-8:00 in general I’m available at any time except TTH: 9:00-12:30. Send me an email and if need be we can meet via zoom, if I don’t reply in a timely fashion send another email and/or post on the class discussion board. Note on medical reasons for extensions/other requirements Educational access is the provision of classroom accommodations, auxiliary aids and services to ensure equal educational opportunities for all students regardless of their disability. Any student who feels he or she may need an accommodation based on the impact of a disability should contact the Office of Disability Services at (216)687-2015. The Office is located in MC 147. Accommodations need to be requested in advance and will not be granted retroactively. Any medical/family issues you have need to be brought to my attention before you take any quiz/exam, once the exam is in your hands no makeup will be oered. Once you begin to take an exam/quiz you may not leave the room until you turn in the quiz/exam. Course Objectives: This course is designed to: 1. Introduce the C programming language. 2. Introduce the concepts of computer programming. 3. Teach students to think about how to approach programming challenges.
    [Show full text]
  • Run-Time Type Information and Incremental Loading in C++
    Run-time Type Information and Incremental Loading in C++ Murali Vemulapati Sriram Duvvuru Amar Gupta WP #3772 September 1993 PROFIT #93-11 Productivity From Information Technology "PROFIT" Research Initiative Sloan School of Management Massachusetts Institute of Technology Cambridge, MA 02139 USA (617)253-8584 Fax: (617)258-7579 Copyright Massachusetts Institute of Technology 1993. The research described herein has been supported (in whole or in part) by the Productivity From Information Technology (PROFIT) Research Initiative at MIT. This copy is for the exclusive use of PROFIT sponsor firms. Productivity From Information Technology (PROFIT) The Productivity From Information Technology (PROFIT) Initiative was established on October 23, 1992 by MIT President Charles Vest and Provost Mark Wrighton "to study the use of information technology in both the private and public sectors and to enhance productivity in areas ranging from finance to transportation, and from manufacturing to telecommunications." At the time of its inception, PROFIT took over the Composite Information Systems Laboratory and Handwritten Character Recognition Laboratory. These two laboratories are now involved in research re- lated to context mediation and imaging respectively. LABORATORY FOR ELEC RONICS A CENTERCFORENTER COORDINATION LABORATORY ) INFORMATION S RESEARCH RESE CH E53-310, MITAL"Room Cambridge, MA 02M142-1247 Tel: (617) 253-8584 E-Mail: [email protected] Run-time Type Information and Incremental Loading in C++ September 13, 1993 Abstract We present the design and implementation strategy for an integrated programming environment which facilitates specification, implementation and execution of persistent C++ programs. Our system is implemented in E, a persistent programming language based on C++. The environment provides type identity and type persistence, i.e., each user-defined class has a unique identity and persistence across compilations.
    [Show full text]
  • A Type-Checking Preprocessor for Cilk 2, a Multithreaded C Language
    A Typechecking Prepro cessor for Cilk a Multithreaded C Language by Rob ert C Miller Submitted to the Department of Electrical Engineering and Computer Science in partial fulllment of the requirements for the degrees of Bachelor of Science in Computer Science and Engineering and Master of Engineering in Electrical Engineering and Computer Science at the Massachusetts Institute of Technology May Copyright Massachusetts Institute of Technology All rights reserved Author ::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::: Department of Electrical Engineering and Computer Science May Certied by ::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::: Charles E Leiserson Thesis Sup ervisor Accepted by ::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::: F R Morgenthaler Chairman Department Committee on Graduate Theses A Typechecking Prepro cessor for Cilk a Multithreaded C Language by Rob ert C Miller Submitted to the Department of Electrical Engineering and Computer Science on May in partial fulllment of the requirements for the degrees of Bachelor of Science in Computer Science and Engineering and Master of Engineering in Electrical Engineering and Computer Science Abstract This thesis describ es the typechecking optimizing translator that translates Cilk a C ex tension language for multithreaded parallel programming into C The CilktoC translator is based on CtoC a to ol I developed that parses type checks analyzes and regenerates a C program With a translator based on CtoC
    [Show full text]