Safe arrays and pointers for C

Size: px
Start display at page:

Download "Safe arrays and pointers for C"

Transcription

1 Safe arrays and pointers for C John Nagle Discussion draft July, 2012 Introduction Buffer overflows continue to plague C and C++ programs. This is a draft proposal for dealing with that problem. The basis of this proposal is to define means for expressing the size of arrays in C. C already has fixed-size arrays with useful semantics. In this proposal, the existing syntax for fixed-size arrays is generalized to allow known-size arrays, where the size of the array is known at variable initialization time. With relatively minor and compatible changes to C, the most troublesome causes of program crashes and security vulnerabilities can be dealt with. In any useful program, each array has a size known to the programmer. In C, there is currently no way to consistently express that size in the language. This proposal adds that capability. Scope An ISO document on common programming language vulnerabilities, Information Technology Programming Languages Guidance to Avoiding Vulnerabilities in Programming Languages through Language Selection and Use, ISO/IEC TR 24772, provides a standard taxonomy of flaws in programming language designs. The specific flaws in C addressed by this proposal are: 6.8 String Termination 6.9 Buffer Boundary Violation (Buffer Overflow) 6.10 Unchecked Array Indexing 6.11 Unchecked Array Copying 6.12 Pointer Casting and Pointer Type Changes 6.13 Pointer Arithmetic 6.14 Null Pointer Dereference 6.40 Type-breaking Reinterpretation of Data These are the errors most closely associated with program crashes and low-level security vulnerabilities. Not addressed are: 6.15 Dangling Reference to Heap 6.41 Memory Leak 07/20/12 Safe arrays and pointers for C - DRAFT 1

2 Preventing errors of those types requires automatic memory management or extensive static analysis. Those flaws are difficult to fix without unacceptably large changes to the C language. Informally, the problem with adding garbage collection to C is that C is the language in which one writes the garbage collector. Summary of language changes The language changes required are minor. Relaxation of existing restrictions Expressions allowed in most array size declarations. (This is the key enhancement.) Features imported from C++11 auto References New reserved words force_cast New predefined functions lengthof(array) array_slice(array, start, end) void array_init(variable, value) void array_zero(variable) New pragma #pragma strict New restrictions (non-strict mode) None on existing code other than avoidance of the reserved word force_cast. New restrictions (strict mode) Conversion from a pointer to an array to a reference to an array of known length requires an explicit force_cast, to indicate that the programmer has commanded an unsafe operation. Conversion from anything which can be NULL to a reference implies a run-time assert check. Unions may not contain pointer or reference types, and all parts of a union must have the same length. 07/20/12 Safe arrays and pointers for C - DRAFT 2

3 To be used for pointer arithmetic, a pointer variable must be initialized at declaration to an element of an array. The only allowed values for the pointer variable used in pointer arithmetic are ones which point to an element of the array to which it was originally assigned. (Pointing to an element one past the end is allowed, for backwards compatibility. Rationale Goals No change to run-time representation of data. (no descriptors or fat pointers ) Minimal modifications to the C language. Define strict and non-strict forms of C modules; existing C99 code can be compiled as non-strict modules and strict modules can interoperate with non-strict modules. If all modules are of strict form, and no unsafe overrides are used, programs should be protected against the flaws listed above. Hidden memory management mechanisms (garbage collection, reference counting) should not be required. Previous work Microsoft source code annotation language (SAL) Cyclone (AT&T research language) SCC, the Safe C compiler. Ccured MemSafe Incompatible dialects and related languages Fixed-size arrays in C and C++ The basis of this proposal is to define means for expressing the size of arrays in C. Most arrays in C and C++ are passed around as pointers, with no size information. There is, however, an exception fixed sized arrays. C and C++ support fixed-sized arrays. Fixed-size arrays are typed objects of known length. They can be defined as types, and, in C++, references to fixed size arrays are fully supported. int arr100[100]; arr100& arr100r; // an array of 100 ints // ref to array of 100 ints This is valid C++ today. C++ already supports the concept of a reference to an array. (Arrays of references are prohibited by the C++ standard, but references to arrays are not.) 07/20/12 Safe arrays and pointers for C - DRAFT 3

4 Where the compiler knows the size of an array, we can use that information. It can be accessed via sizeof. This is convenient, but only useful for arrays of fixed size. C99 dynamically sized arrays C99 added support for dynamically sized temporary arrays. This feature is often used in numerical code, where it is common to call a function which needs a temporary array for the duration of the function call. float mathfn(const float in[ ], size_t n) { float workarr[n]; // work array of length n } return(result); This was the first place in C where an array could be resized at compile time with the compiler aware of the size. Known-size arrays. The existing syntax and semantics of fixed-size arrays, C99 dynamically sized arrays, and C++ references can, with slight extensions, allow the support of known-sized arrays. The only syntactical change required is to allow expressions in a few places where, at present, only constants are allowed. It is proposed to allow expressions in array sizes in type declarations in the following places: local variable and typedef declarations function parameter declarations casts within initialization expressions structure definitions (under certain restrictions) When a known-sized array is defined or passed as a parameter, its size is the value of the dimension expression evaluated at initialization time. This allows a function such as the following: void copybyref(int (&a)[n], const int (&b)[n], size_t n) { for (int i = 0; i < lengthof(a); i++) { a[i] = b[i]; } } This is a size-safe copy, intended to be used as follows: int a0[100], a1[100]; copybyref(a1, a0); // defined with a type declaration // copy array of known size 07/20/12 Safe arrays and pointers for C - DRAFT 4

5 int b0[50], b1[50]; copybyref(b0, b1, 50); copybyref(b0, a0, 100); // smaller arrays // copy array of a different size // size mismatch compile time error The last copybyref call is an error, because the array sizes do not match. For a constant n this can be caught at compile time. For a variable n, it has to be a run time check. The compiler must check, at a call to copybyref : assert(lengthof(a) == n); assert(lengthof(b) == n); If the programmer calls copybyref as follows: copybyref(b0, a0, lengthof(b0)); The checks become assert(lengthof(b0) == lengthof(b0)); assert(lengthof(a0) == lengthof(b0)); The first check is optimized out as an identity. The second check still requires a run-time check. But only one check per function call is required. This is far cheaper than general subscript checking. Here, a run-time check is required only because two arrays must match. In many common cases, especially some of the classic causes of buffer overflows, there is no additional overhead. For example, the classic UNIX read call would now be expressed as: int read(int fd, char(&buf)[n], size_t n); The required check is If called with assert(lengthof(buf) == n); int buf[512];... int stat = read(fd, buf, lengthof(buf)); the check required is assert(lengthof(buf) == lengthof(buf)); which is optimized out as an identity. Worth noting is that the function declaration of read above is, in non-strict mode, compatible with existing code which passes buf as a pointer to a char. Why references? A key part of this proposal is the use of C++ style references in C. As shown above, references to 07/20/12 Safe arrays and pointers for C - DRAFT 5

6 arrays can already contain size information about the array. Pointers to arrays in C refer to the type of the first element, with no array length information. Changing the semantics of pointers in C would break existing code. Adding references to the C language will not break anything. C++ already has both references and pointers. The relationship between the two is well understood and not a cause of trouble, so this can be done with confidence. Strict mode The enhancements to C syntax and semantics described here are backwards compatible with existing C code. Beyond this is strict mode which disallows some unsafe constructs and operations. Strict mode requires known size arrays in situations where overflow is possible. Strict mode is defined on a persource-file basis. Strict and non-strict code can interoperate. New rules enforced in strict mode: Conversion from a pointer to an array to a reference to an array of known length requires an explicit force_cast, to indicate that the programmer has commanded an unsafe operation. Conversion from anything which can be NULL to a reference implies a run-time assert check. Unions cannot contain pointers or references, and all alternatives of a union must have the same size. Programs written in strict mode should be protected against the list of memory safety errors covered in the scope section above. This should eliminate most buffer overflow problems. Strict mode for a compilation unit is indicated by or _Pragma("strict") #pragma strict Implications of known-size arrays With known-sized arrays and strict mode introduced, their use and consequences can be examined. How array size information is stored There are no array descriptors involved. The programmer tells the compiler the size of the array as an expression, and that expression is evaluated at the point in the program where the relevant declaration appears. int asize = 100; // size wanted int atab[asize]; // declare known-size array asize = 200; // this does not resize the array printf( Length of atab is %d\n, lengthof(atab)); // prints 100 In the above worst case example, the compiler must generate a temporary is needed to store the size of the array, because the inputs to the expression defining its size change. This is usually unnecessary. 07/20/12 Safe arrays and pointers for C - DRAFT 6

7 Reference declarations C99 already allows variable declarations to be interspersed with executable code. References must be initialized in C++, and this restriction would be maintained with references in C. So references will generally be initialized near the point of first use. We are now allowing expressions in array sizes in declarations, and that expression must be evaluated where the declaration appears. int b[100];... int (&rb)[lengthof(b)] = b; // array of 100 ints // ref to array b Assignments to references are subject to type checking. Where the reference on the left hand side has a known length determined at run time, this may imply a run-time assert check on array size. This is considered a subscript check, as defined below. Casts The syntax of casts follows that for declarations. As with reference declarations, the size must be evaluated at the point of the cast. Casts with expressions in array sizes are allowed in initialization expressions. Ordinary casts must be memory-safe in strict mode. Unsafe casts must be expressed using some specific syntax, as with reinterpret_cast in C++. Unfortunately, the syntax of reinterpret_cast uses the corner-bracket template notation of C++, and is inappropriate for C. We need some syntax to indicate that a cast is forced in violation of normal type rules. This, like most syntax issues is a politically touchy problem. A solution should be Consistent with the expectation of C programmers. Backwards compatible with existing code Findable by simple searches to enable easy code auditing. One option is a special storage class, used only in casts. A phrase such as forced_cast might be appropriate: int val = 1234; char* ptr = (forced_cast char*)val; // UNSAFE Even in strict mode, this would be required only when forcing a conversion which could impact memory safety. So such casts would be quite rare. A few casts can generate run-time checks. Conversion of a pointer to a reference must generate an assert check. Such checks are enabled when subscript checking is enabled. Dynamic allocation ( malloc and its friends) This is one of the more difficult problems to handle safely. Yet, as it is frequently a source of program bugs of the buffer overflow variety, it it necessary to do so. The problems which must be addressed include: The classical return type of malloc, void *, cannot express size information. 07/20/12 Safe arrays and pointers for C - DRAFT 7

8 Because malloc can return NULL, it is not permissible to directly generate a reference from memory allocation. Nor can allocation failure be handled via an exception. Pointers to references are not allowed. Structures which contain references must be initialized. The syntax for allocating memory must be concise. Backwards compatibility with existing code must be maintained in non-strict mode. All those constraints, taken together, create a tough problem. A few options: Allocation functions which raise a signal on failure. This impacts program structure, but provides the cleanest syntax. char (&p)[n] = MALLOCARRAY(char, n); with a suitable macro, is a clean, concise syntax, but there's no way to handle the error condition in in-line code. It's worth providing this for routine applications which do not need sophisticated out-of-memory handling. Return a pointer to a reference to the object, or null. With some encapsulation in a macro, we can insure that the necessary casting is type-safe. #define MALLOC(T) (T*)malloc(sizeof(T)) // safe allocator If we use this to allocate an array of known size, the result is a pointer to the array as an object, or NULL. size_t n = 100; // desired array size... typedef int tab[n]; tab* p = MALLOC(tab); if (p == NULL) return(false); tab& tab1 = *p; // get ref from ref to pointer... tab1[10] = 1; // array of known size n // alloc a "tab" // handle allocation failure // it's a valid array This is type-safe and size-safe. Note that there are no casts other than inside the define. Initialization of dynamically allocated space In C, malloc normally provides memory space containing old semi-random data. For most data types, this is not a safety problem. However, for pointer safety, we must insure that allocated items with pointers or references are initialized. Zeroing new memory space is not an option for references, and because we're encouraging the use of references in place of pointers, this has to be done right. So, when a new struct or array or structs is allocated, and the struct type contains a pointer or reference, it must be initialized from an initial value of that type. 07/20/12 Safe arrays and pointers for C - DRAFT 8

9 Syntax for this has yet to be defined. Something like struct item { size_t len; char (&) msg[len]; }; const char[] msg1 = Hello, world ; const itemproto = { sizeof(msg1), msg1); item*p = MALLOC(item, itemproto); suggests itself. Underneath that macro, a built-in generic function is required for the initialization operation. This is a safe replacement for the classic bcopy. void array_init(variable, value) This simply copies value into variable, with type checking. The variable parameter can be an array of known or fixed size. This is needed because array assignment isn't allowed, and assignment to an array reference assigns the reference, not the content. In C++, we could write this as a template function, but in C, any generic function must be a built-in. As a convenience, a safe replacement for the common bzero is provided: void array_zero(variable) This simply sets the array to binary zero. It is a compile-time error to use this on an array of structures containing references. Associating length with an array pointer in a structure We might now want a structure which carries both the array and its size. The pointer-based form is typedef str { size_t len, char* data}; New reference form: typedef str { size_t len, char (&data)[len]); str s1 = {n, MALLOC(char, n) }; // structure initialization The key point here is that char (&data)[len] is a reference to a string of known length. The length, len, is an element in the same structure. This ties the length of the array to a value which can be found from the structure. This tie is a property of the type declaration. The general rule for such declarations is that the dimension expression is evaluated in the context of the struct. Fields of the struct may appear in the expression. As a convenience, lengthof(s1.data) is then well defined. 07/20/12 Safe arrays and pointers for C - DRAFT 9

10 This idiom is only valid for structures initialized all at once through structure initialization. A struct with an array as the last component A special case is typedef struct item { size_t itemlength; char itemvalue[itemlength]; }; This is permitted. The size of the object is calculated based on the value of itemlength. Such structs should be initialized as a unit, with an initialization expression. In strict mode, assignment to the length is not permitted after initialization. Impact on other language features The basic proposal has now been described. The impact of the proposal on various features of the C language is next. Unions In strict mode, elements of unions are restricted to non-pointer and non-reference types, and all alternatives must be the same size. In most existing code, unions are used primarily for data being passed through networks, files, and message passing systems. Such data, since it comes from external sources, seldom contains pointers. Adding language support for safe discriminated variant records, as was done in Cyclone, seems excessive for the infrequency with which it would be used. In strict mode, the only way to override pointer type safety is through the explicit use of force_cast. This make it easy to search and audit programs for pointer type problems. Multidimensional arrays Multidimensional arrays of known size are supported. This simply generalizes the existing rules for multidimensional fixed-size arrays. size_t order = 3; float tab[order][order]; // square array of order N. As with arrays of fixed size, these are not arrays of pointers, but dense arrays of elements. This will be a great convenience in numerical work. There is also a performance gain. On modern CPUs, multiplying by row size to compute a row offset is faster than accessing a table of pointers. Pointer arithmetic Pointer arithmetic is a standard idiom of C programming. Although it would be safer to eliminate it from the language, that isn't feasible for an update to C. 07/20/12 Safe arrays and pointers for C - DRAFT 10

11 The most common uses of pointer arithmetic use local variables which are bound to a single array throughout their life. Such pointers behave much like C++ iterators. So we can allow pointer arithmetic under much the same restrictions applied to iterators. These are: The pointer variable must be initialized at its declaration to an element of an array. The only allowed values for the pointer variable are ones which point to an element of the array to which it was originally assigned. (Pointing to an element one past the end is allowed, for backwards compatibility. Pointers with such properties are safe for pointer arithmetic purposes, provided there is range checking. Range checking for such pointers is possible without fat pointers, because the array to which they are bound is known at compile time. Unsafe pointer arithmetic is allowed only through force_cast. String constants String constants have type char (&)[length] or wchar_t(&)[length]. These types will convert to char* or wchar_t* for compatibility with non-strict code. The sizeof and lengthof functions can be applied and count the usual trailing null. Null-terminated strings are a problem. A workable solution is to allow read access to const arrays without subscript checking. This allows reading junk, but not overwriting other variables. Standard library safety Library function can be categorized as follows: Can be made fully compatible and safe with arrays of known size read, write, fread, fwrite, etc. Unsafe and already deprecated gets, sprintf, etc. These would be unavailable in strict mode. Safe for write, but not for read printf, snprintf, etc. Permitted in strict mode on the grounds that the impact of disallowing them is too high. Unsafe sscanf, which stores into memory based on format strings. Unavailable in strict mode. Library issues are beyond the scope of this document, but appear to be manageable. Subscript checking With enough information available to perform subscript checking, implementations may offer it as an option. The question is what to do when a run time error is detected. The available options are to take the action defined for an assert failure, or to raise a signal. That decision can be left to the implementation. It is strongly recommended that implementations which do subscript checking optimize it. As a minimum, the following is suggested: common subexpression optimization should be applied to subscript checks within loops. Within for loops, checks should be hoisted to the beginning of the loop and done once per 07/20/12 Safe arrays and pointers for C - DRAFT 11

12 loop if at all possible. Hoisted checks which resolve to constant expressions or identities should be evaluated at compile time, and reported as errors (if failing) or optimize out (if succeeding). The array must not have a scope narrower than that of the pointer variable, so that the array cannot go out of scope while the pointer variable is still in scope. The goal of the above is to optimize out most, if not all, subscript checks in inner loops of common matrix calculations. It is explicitly permitted to detect and act on a subscript error as soon as it becomes inevitable. In other words, if an implementation can detect that a subscript error will occur on some iteration of a loop, and there is no way to exit the loop before reaching that iteration, the subscript error can be reported at entry to the loop. A potential exit from the loop via break or return must inhibit this optimization. A potential exit via longjmp or exit, which might be hidden in a called function, would not be considered to inhibit this optimization. Convenience features With the language aware of array length, some convenience features can be added to make programming easier. These are all optional from the programmer's perspective, and need not be retrofitted to existing code. auto storage type as in C++ 20xx. auto, from C++11, is added to C. The motivation for this is the long declarations required for references to complex arrays. lengthof C has a built-in sizeof function. It's common to define lengthof, returning the number of elements of an array, as a macro. It is proposed to make lengthof a standard. Both sizeof and lengthof are defined for arrays of known size. This makes the size of an array immediately and reliably available to code. Iteration over an array Almost all languages defined in the last 20 years (with the notable exception of JavaScript) have syntax for iterating over all the elements of a collection. For arrays of known size, the compiler now has enough information to provide such a construct. The syntax of this may be controversial, and needs discussion. Some options include for (auto x in arr) { } for (auto x forall arr) { } Making in a reserved word impacts existing code, but yields the nicest syntax. Using this feature with auto leads to concise loop statements which are not error prone. Suggestions in this area are welcome. 07/20/12 Safe arrays and pointers for C - DRAFT 12

13 Subarray syntax At times, it is desirable to talk about a subarray of an array. The existing C syntax for this is char arr[100] char p[] = &arr[20]; This tends to be error-prone, as the size of the subarray is rather vague. So it is proposed to borrow the slice operation from Javascript: char arr[100] char (&p)[80] = array_slice(arr, 20, 100); Following the Javascript and Python convention, the limits of slice are the start index and the end index + 1. Negative, overlapping, and out of bounds indices are errors and should be detected if subscript checking is enabled. Another option is to borrow Python's subarray syntax: Char arr[100]; char (&p)[80] = arr[20:100]; // reference to a subarray of arr This is concise, but more controversial, as it involves new syntax. It has the advantage that subarray references could be allowed on the left side of an assignment. Conclusion Alternatives Making C a memory safe language without unduly changing the language is difficult. This proposal is intended as a direction for standard C, and as such, must be quite conservative in the changes proposed. Annotation systems, such as Microsoft's SAL, can be effective if used. Because they're not integrated into the language, they tend to make programs more verbose. Thus, they're rarely used without strong managerial pressure. Cyclone has a reasonable set of extensions, but strays far enough from C that it's a different language. Cyclone offers three types of pointers - normal, never-null, and fat. New symbols and? ) are used to designate the different types of pointers. Fat pointers imply hidden run-time machinery. This is a valid approach, but it is not C. SCC, the Safe C compiler, is claimed to be able to detect all pointer and access errors at run time. However, it required using an elaborate data structure for every pointer and substantial run-time overhead. C++ addresses safety by trying to hide the unsafe constructs of C under a layer of standard templates. In practice, the templated constructs tend to leak raw C pointers, and buffer overflows in C++ applications are still common. Other variants such as Objective-C and Java are useful languages, but they are not C. 07/20/12 Safe arrays and pointers for C - DRAFT 13

14 Limitations This approach still doesn't solve the dangling-pointer problem. There's no good way to do that without more memory management machinery behind the scenes. The goal here was to avoid adding hidden machinery. 07/20/12 Safe arrays and pointers for C - DRAFT 14

15 Appendix 1 Examples From the UNIX/POSIX API: Original function declarations: New form: int read(int fd, char* buf, size_t n); int read(int fd, char (&)buf[n], size_t n); This is size-safe when called from new code, and compatible with old code that passes a char* as a parameter. From Numerical Recipes in C, Gauss-Jordan elimination: Original function declaration: void gaussj(float **a, int n, float **b, int m); New form: void gaussj(float (a&)[n][n], int n, float (&b)[n][m], int m); In the original, the array bounds have to be explained in comments. (More to follow) 07/20/12 Safe arrays and pointers for C - DRAFT 15

Safe arrays and pointers for C through compatible additions to the language

Safe arrays and pointers for C through compatible additions to the language Safe arrays and pointers for C through compatible additions to the language John Nagle Discussion draft, round 2 August/September, 2012 Introduction Buffer overflows continue to plague C and C++ programs.

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Semantic Analysis: Types and Type Checking

Semantic Analysis: Types and Type Checking Semantic Analysis Semantic Analysis: Types and Type Checking CS 471 October 10, 2007 Source code Lexical Analysis tokens Syntactic Analysis AST Semantic Analysis AST Intermediate Code Gen lexical errors

More information

5 Arrays and Pointers

5 Arrays and Pointers 5 Arrays and Pointers 5.1 One-dimensional arrays Arrays offer a convenient way to store and access blocks of data. Think of arrays as a sequential list that offers indexed access. For example, a list of

More information

1 Abstract Data Types Information Hiding

1 Abstract Data Types Information Hiding 1 1 Abstract Data Types Information Hiding 1.1 Data Types Data types are an integral part of every programming language. ANSI-C has int, double and char to name just a few. Programmers are rarely content

More information

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014 CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages Nicki Dell Spring 2014 What is a Programming Language? A set of symbols and associated tools that translate (if necessary) collections

More information

The programming language C. sws1 1

The programming language C. sws1 1 The programming language C sws1 1 The programming language C invented by Dennis Ritchie in early 1970s who used it to write the first Hello World program C was used to write UNIX Standardised as K&C (Kernighan

More information

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists

Lecture 11 Doubly Linked Lists & Array of Linked Lists. Doubly Linked Lists Lecture 11 Doubly Linked Lists & Array of Linked Lists In this lecture Doubly linked lists Array of Linked Lists Creating an Array of Linked Lists Representing a Sparse Matrix Defining a Node for a Sparse

More information

Memory management. Announcements. Safe user input. Function pointers. Uses of function pointers. Function pointer example

Memory management. Announcements. Safe user input. Function pointers. Uses of function pointers. Function pointer example Announcements Memory management Assignment 2 posted, due Friday Do two of the three problems Assignment 1 graded see grades on CMS Lecture 7 CS 113 Spring 2008 2 Safe user input If you use scanf(), include

More information

Stacks. Linear data structures

Stacks. Linear data structures Stacks Linear data structures Collection of components that can be arranged as a straight line Data structure grows or shrinks as we add or remove objects ADTs provide an abstract layer for various operations

More information

C++ INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get

More information

MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00

MPLAB TM C30 Managed PSV Pointers. Beta support included with MPLAB C30 V3.00 MPLAB TM C30 Managed PSV Pointers Beta support included with MPLAB C30 V3.00 Contents 1 Overview 2 1.1 Why Beta?.............................. 2 1.2 Other Sources of Reference..................... 2 2

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February

More information

C++ Programming Language

C++ Programming Language C++ Programming Language Lecturer: Yuri Nefedov 7th and 8th semesters Lectures: 34 hours (7th semester); 32 hours (8th semester). Seminars: 34 hours (7th semester); 32 hours (8th semester). Course abstract

More information

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas

Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage

More information

Chapter 5 Names, Bindings, Type Checking, and Scopes

Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named

More information

Coding Rules. Encoding the type of a function into the name (so-called Hungarian notation) is forbidden - it only confuses the programmer.

Coding Rules. Encoding the type of a function into the name (so-called Hungarian notation) is forbidden - it only confuses the programmer. Coding Rules Section A: Linux kernel style based coding for C programs Coding style for C is based on Linux Kernel coding style. The following excerpts in this section are mostly taken as is from articles

More information

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

KITES TECHNOLOGY COURSE MODULE (C, C++, DS) KITES TECHNOLOGY 360 Degree Solution www.kitestechnology.com/academy.php info@kitestechnology.com technologykites@gmail.com Contact: - 8961334776 9433759247 9830639522.NET JAVA WEB DESIGN PHP SQL, PL/SQL

More information

Týr: a dependent type system for spatial memory safety in LLVM

Týr: a dependent type system for spatial memory safety in LLVM Týr: a dependent type system for spatial memory safety in LLVM Vítor De Araújo Álvaro Moreira (orientador) Rodrigo Machado (co-orientador) August 13, 2015 Vítor De Araújo Álvaro Moreira (orientador) Týr:

More information

C Interview Questions

C Interview Questions http://techpreparation.com C Interview Questions And Answers 2008 V i s i t T e c h P r e p a r a t i o n. c o m f o r m o r e i n t e r v i e w q u e s t i o n s a n d a n s w e r s C Interview Questions

More information

C and C++: Case Studies in Compatibility

C and C++: Case Studies in Compatibility C and C++: Case Studies in Compatibility Bjarne Stroustrup AT&T Labs Florham Park, NJ, USA ABSTRACT This article gives examples of how one might go about increasing the degree of compatibility of C and

More information

Programming languages C

Programming languages C INTERNATIONAL STANDARD ISO/IEC 9899:1999 TECHNICAL CORRIGENDUM 2 Published 2004-11-15 INTERNATIONAL ORGANIZATION FOR STANDARDIZATION МЕЖДУНАРОДНАЯ ОРГАНИЗАЦИЯ ПО СТАНДАРТИЗАЦИИ ORGANISATION INTERNATIONALE

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C 1 An essential part of any embedded system design Programming 2 Programming in Assembly or HLL Processor and memory-sensitive

More information

OpenACC 2.0 and the PGI Accelerator Compilers

OpenACC 2.0 and the PGI Accelerator Compilers OpenACC 2.0 and the PGI Accelerator Compilers Michael Wolfe The Portland Group michael.wolfe@pgroup.com This presentation discusses the additions made to the OpenACC API in Version 2.0. I will also present

More information

N3458: Simple Database Integration in C++11

N3458: Simple Database Integration in C++11 N3458: Simple Database Integration in C++11 Thomas Neumann Technische Univeristät München neumann@in.tum.de 2012-10-22 Many applications make use of relational database to store and query their data. However,

More information

The Advantages of Dan Grossman CSE303 Spring 2005, Lecture 25

The Advantages of Dan Grossman CSE303 Spring 2005, Lecture 25 CSE 303: Concepts and Tools for Software Development Dan Grossman Spring 2005 Lecture 25 Memory-Management Idioms Dan Grossman CSE303 Spring 2005, Lecture 25 1 No tools or rule today Review: Java and C

More information

CSCI E 98: Managed Environments for the Execution of Programs

CSCI E 98: Managed Environments for the Execution of Programs CSCI E 98: Managed Environments for the Execution of Programs Draft Syllabus Instructor Phil McGachey, PhD Class Time: Mondays beginning Sept. 8, 5:30-7:30 pm Location: 1 Story Street, Room 304. Office

More information

Base Conversion written by Cathy Saxton

Base Conversion written by Cathy Saxton Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,

More information

Illustration 1: Diagram of program function and data flow

Illustration 1: Diagram of program function and data flow The contract called for creation of a random access database of plumbing shops within the near perimeter of FIU Engineering school. The database features a rating number from 1-10 to offer a guideline

More information

C++FA 3.1 OPTIMIZING C++

C++FA 3.1 OPTIMIZING C++ C++FA 3.1 OPTIMIZING C++ Ben Van Vliet Measuring Performance Performance can be measured and judged in different ways execution time, memory usage, error count, ease of use and trade offs usually have

More information

Syntax Check of Embedded SQL in C++ with Proto

Syntax Check of Embedded SQL in C++ with Proto Proceedings of the 8 th International Conference on Applied Informatics Eger, Hungary, January 27 30, 2010. Vol. 2. pp. 383 390. Syntax Check of Embedded SQL in C++ with Proto Zalán Szűgyi, Zoltán Porkoláb

More information

A Test Suite for Basic CWE Effectiveness. Paul E. Black. paul.black@nist.gov. http://samate.nist.gov/

A Test Suite for Basic CWE Effectiveness. Paul E. Black. paul.black@nist.gov. http://samate.nist.gov/ A Test Suite for Basic CWE Effectiveness Paul E. Black paul.black@nist.gov http://samate.nist.gov/ Static Analysis Tool Exposition (SATE V) News l We choose test cases by end of May l Tool output uploaded

More information

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding Compiling Object Oriented Languages What is an Object-Oriented Programming Language? Last time Dynamic compilation Today Introduction to compiling object oriented languages What are the issues? Objects

More information

Tutorial on C Language Programming

Tutorial on C Language Programming Tutorial on C Language Programming Teodor Rus rus@cs.uiowa.edu The University of Iowa, Department of Computer Science Introduction to System Software p.1/64 Tutorial on C programming C program structure:

More information

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 Oct 4, 2013, p 1 Name: CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013 1. (max 18) 4. (max 16) 2. (max 12) 5. (max 12) 3. (max 24) 6. (max 18) Total: (max 100)

More information

Oracle Solaris Studio Code Analyzer

Oracle Solaris Studio Code Analyzer Oracle Solaris Studio Code Analyzer The Oracle Solaris Studio Code Analyzer ensures application reliability and security by detecting application vulnerabilities, including memory leaks and memory access

More information

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint) TN203 Porting a Program to Dynamic C Introduction Dynamic C has a number of improvements and differences compared to many other C compiler systems. This application note gives instructions and suggestions

More information

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc()

Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() CS61: Systems Programming and Machine Organization Harvard University, Fall 2009 Lecture 10: Dynamic Memory Allocation 1: Into the jaws of malloc() Prof. Matt Welsh October 6, 2009 Topics for today Dynamic

More information

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.

Organization of Programming Languages CS320/520N. Lecture 05. Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio. Organization of Programming Languages CS320/520N Razvan C. Bunescu School of Electrical Engineering and Computer Science bunescu@ohio.edu Names, Bindings, and Scopes A name is a symbolic identifier used

More information

CS 6371: Advanced Programming Languages

CS 6371: Advanced Programming Languages CS 6371: Advanced Programming Languages Dr. Kevin Hamlen Spring 2014 Fill out, sign, and return prereq forms: Course number: CS 6371 Section: 1 Prerequisites: CS 5343: Algorithm Analysis & Data Structures

More information

CS106A, Stanford Handout #38. Strings and Chars

CS106A, Stanford Handout #38. Strings and Chars CS106A, Stanford Handout #38 Fall, 2004-05 Nick Parlante Strings and Chars The char type (pronounced "car") represents a single character. A char literal value can be written in the code using single quotes

More information

The Power of Ten Rules for Developing Safety Critical Code 1. Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109

The Power of Ten Rules for Developing Safety Critical Code 1. Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109 The Power of Ten Rules for Developing Safety Critical Code 1 Gerard J. Holzmann NASA/JPL Laboratory for Reliable Software Pasadena, CA 91109 Most serious software development projects use coding guidelines.

More information

Applying Clang Static Analyzer to Linux Kernel

Applying Clang Static Analyzer to Linux Kernel Applying Clang Static Analyzer to Linux Kernel 2012/6/7 FUJITSU COMPUTER TECHNOLOGIES LIMITED Hiroo MATSUMOTO 管 理 番 号 1154ka1 Copyright 2012 FUJITSU COMPUTER TECHNOLOGIES LIMITED Abstract Now there are

More information

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Symbol Tables. Introduction

Symbol Tables. Introduction Symbol Tables Introduction A compiler needs to collect and use information about the names appearing in the source program. This information is entered into a data structure called a symbol table. The

More information

8.5. <summary>...26 9. Cppcheck addons...27 9.1. Using Cppcheck addons...27 9.1.1. Where to find some Cppcheck addons...27 9.2.

8.5. <summary>...26 9. Cppcheck addons...27 9.1. Using Cppcheck addons...27 9.1.1. Where to find some Cppcheck addons...27 9.2. Cppcheck 1.72 Cppcheck 1.72 Table of Contents 1. Introduction...1 2. Getting started...2 2.1. First test...2 2.2. Checking all files in a folder...2 2.3. Excluding a file or folder from checking...2 2.4.

More information

Lecture 18-19 Data Types and Types of a Language

Lecture 18-19 Data Types and Types of a Language Lecture 18-19 Data Types and Types of a Language April 29, 2014 Data Types and Types of a Language Data, Data Types and Types Type: Generalities Type Systems and Type Safety Type Equivalence, Coercion

More information

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example

Operator Overloading. Lecture 8. Operator Overloading. Running Example: Complex Numbers. Syntax. What can be overloaded. Syntax -- First Example Operator Overloading Lecture 8 Operator Overloading C++ feature that allows implementer-defined classes to specify class-specific function for operators Benefits allows classes to provide natural semantics

More information

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++

1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ Answer the following 1) The postfix expression for the infix expression A+B*(C+D)/F+D*E is ABCD+*F/DE*++ 2) Which data structure is needed to convert infix notations to postfix notations? Stack 3) The

More information

CORBA Programming with TAOX11. The C++11 CORBA Implementation

CORBA Programming with TAOX11. The C++11 CORBA Implementation CORBA Programming with TAOX11 The C++11 CORBA Implementation TAOX11: the CORBA Implementation by Remedy IT TAOX11 simplifies development of CORBA based applications IDL to C++11 language mapping is easy

More information

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives Introduction to Programming and Algorithms Module 1 CS 146 Sam Houston State University Dr. Tim McGuire Module Objectives To understand: the necessity of programming, differences between hardware and software,

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Friendship and Encapsulation in C++

Friendship and Encapsulation in C++ Friendship and Encapsulation in C++ Adrian P Robson Department of Computing University of Northumbria at Newcastle 23rd October 1995 Abstract There is much confusion and debate about friendship and encapsulation

More information

Securing software by enforcing data-flow integrity

Securing software by enforcing data-flow integrity Securing software by enforcing data-flow integrity Miguel Castro Microsoft Research Manuel Costa Microsoft Research University of Cambridge Tim Harris Microsoft Research Abstract Software attacks often

More information

Variable Base Interface

Variable Base Interface Chapter 6 Variable Base Interface 6.1 Introduction Finite element codes has been changed a lot during the evolution of the Finite Element Method, In its early times, finite element applications were developed

More information

10CS35: Data Structures Using C

10CS35: Data Structures Using C CS35: Data Structures Using C QUESTION BANK REVIEW OF STRUCTURES AND POINTERS, INTRODUCTION TO SPECIAL FEATURES OF C OBJECTIVE: Learn : Usage of structures, unions - a conventional tool for handling a

More information

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T) Unit- I Introduction to c Language: C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating

More information

Java from a C perspective. Plan

Java from a C perspective. Plan Java from a C perspective Cristian Bogdan 2D2052/ingint04 Plan Objectives and Book Packages and Classes Types and memory allocation Syntax and C-like Statements Object Orientation (minimal intro) Exceptions,

More information

Microcontrollers Deserve Protection Too

Microcontrollers Deserve Protection Too Microcontrollers Deserve Protection Too Amit Levy with: Michael Andersen, Tom Bauer, Sergio Benitez, Bradford Campbell, David Culler, Prabal Dutta, Philip Levis, Pat Pannuto, Laurynas Riliskis Microcontrollers

More information

Sources: On the Web: Slides will be available on:

Sources: On the Web: Slides will be available on: C programming Introduction The basics of algorithms Structure of a C code, compilation step Constant, variable type, variable scope Expression and operators: assignment, arithmetic operators, comparison,

More information

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java

More information

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007 The Java Type System By now, you have seen a fair amount of Java. Time to study in more depth the foundations of the language,

More information

Object Oriented Software Design II

Object Oriented Software Design II Object Oriented Software Design II Real Application Design Christian Nastasi http://retis.sssup.it/~lipari http://retis.sssup.it/~chris/cpp Scuola Superiore Sant Anna Pisa April 25, 2012 C. Nastasi (Scuola

More information

Lab Experience 17. Programming Language Translation

Lab Experience 17. Programming Language Translation Lab Experience 17 Programming Language Translation Objectives Gain insight into the translation process for converting one virtual machine to another See the process by which an assembler translates assembly

More information

Lab 4: Socket Programming: netcat part

Lab 4: Socket Programming: netcat part Lab 4: Socket Programming: netcat part Overview The goal of this lab is to familiarize yourself with application level programming with sockets, specifically stream or TCP sockets, by implementing a client/server

More information

C# and Other Languages

C# and Other Languages C# and Other Languages Rob Miles Department of Computer Science Why do we have lots of Programming Languages? Different developer audiences Different application areas/target platforms Graphics, AI, List

More information

MPLAB Harmony System Service Libraries Help

MPLAB Harmony System Service Libraries Help MPLAB Harmony System Service Libraries Help MPLAB Harmony Integrated Software Framework v1.08 All rights reserved. This section provides descriptions of the System Service libraries that are available

More information

Elemental functions: Writing data-parallel code in C/C++ using Intel Cilk Plus

Elemental functions: Writing data-parallel code in C/C++ using Intel Cilk Plus Elemental functions: Writing data-parallel code in C/C++ using Intel Cilk Plus A simple C/C++ language extension construct for data parallel operations Robert Geva robert.geva@intel.com Introduction Intel

More information

CS 111 Classes I 1. Software Organization View to this point:

CS 111 Classes I 1. Software Organization View to this point: CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects

More information

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void

Keywords are identifiers having predefined meanings in C programming language. The list of keywords used in standard C are : unsigned void 1. Explain C tokens Tokens are basic building blocks of a C program. A token is the smallest element of a C program that is meaningful to the compiler. The C compiler recognizes the following kinds of

More information

/* File: blkcopy.c. size_t n

/* File: blkcopy.c. size_t n 13.1. BLOCK INPUT/OUTPUT 505 /* File: blkcopy.c The program uses block I/O to copy a file. */ #include main() { signed char buf[100] const void *ptr = (void *) buf FILE *input, *output size_t

More information

Crash Course in Java

Crash Course in Java Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is

More information

Programming Languages CIS 443

Programming Languages CIS 443 Course Objectives Programming Languages CIS 443 0.1 Lexical analysis Syntax Semantics Functional programming Variable lifetime and scoping Parameter passing Object-oriented programming Continuations Exception

More information

A deeper look at Inline functions

A deeper look at Inline functions A deeper look at Inline functions I think it s safe to say that all Overload readers know what C++ inline functions are. When we declare a function or member function as inline we are trying to avoid the

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

arrays C Programming Language - Arrays

arrays C Programming Language - Arrays arrays So far, we have been using only scalar variables scalar meaning a variable with a single value But many things require a set of related values coordinates or vectors require 3 (or 2, or 4, or more)

More information

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6)

Scoping (Readings 7.1,7.4,7.6) Parameter passing methods (7.5) Building symbol tables (7.6) Semantic Analysis Scoping (Readings 7.1,7.4,7.6) Static Dynamic Parameter passing methods (7.5) Building symbol tables (7.6) How to use them to find multiply-declared and undeclared variables Type checking

More information

Computational Mathematics with Python

Computational Mathematics with Python Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40

More information

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is preceded by an equal sign d. its name has undereline 2. Associations

More information

To Java SE 8, and Beyond (Plan B)

To Java SE 8, and Beyond (Plan B) 11-12-13 To Java SE 8, and Beyond (Plan B) Francisco Morero Peyrona EMEA Java Community Leader 8 9...2012 2020? Priorities for the Java Platforms Grow Developer Base Grow Adoption

More information

How To Write Portable Programs In C

How To Write Portable Programs In C Writing Portable Programs COS 217 1 Goals of Today s Class Writing portable programs in C Sources of heterogeneity Data types, evaluation order, byte order, char set, Reading period and final exam Important

More information

Static Code Analysis Procedures in the Development Cycle

Static Code Analysis Procedures in the Development Cycle Static Code Analysis Procedures in the Development Cycle Tools, Technology, and Process in Engineering at Microsoft Mooly Beeri Microsoft Haifa R&D Center Agenda Static code analysis tools PREfix and PREfast

More information

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2 SMTP-32 Library Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows Version 5.2 Copyright 1994-2003 by Distinct Corporation All rights reserved Table of Contents 1 Overview... 5 1.1

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

Basic Use of the TI-84 Plus

Basic Use of the TI-84 Plus Basic Use of the TI-84 Plus Topics: Key Board Sections Key Functions Screen Contrast Numerical Calculations Order of Operations Built-In Templates MATH menu Scientific Notation The key VS the (-) Key Navigation

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

More information

ECS 165B: Database System Implementa6on Lecture 2

ECS 165B: Database System Implementa6on Lecture 2 ECS 165B: Database System Implementa6on Lecture 2 UC Davis, Spring 2011 Por6ons of slides based on earlier ones by Raghu Ramakrishnan, Johannes Gehrke, Jennifer Widom, Bertram Ludaescher, and Michael Gertz.

More information

Introduction to Programming System Design. CSCI 455x (4 Units)

Introduction to Programming System Design. CSCI 455x (4 Units) Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,

More information

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c

Lecture 3. Arrays. Name of array. c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] c[10] c[11] Position number of the element within array c Lecture 3 Data structures arrays structs C strings: array of chars Arrays as parameters to functions Multiple subscripted arrays Structs as parameters to functions Default arguments Inline functions Redirection

More information

VHDL Test Bench Tutorial

VHDL Test Bench Tutorial University of Pennsylvania Department of Electrical and Systems Engineering ESE171 - Digital Design Laboratory VHDL Test Bench Tutorial Purpose The goal of this tutorial is to demonstrate how to automate

More information

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich

I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation. Mathias Payer, ETH Zurich I Control Your Code Attack Vectors Through the Eyes of Software-based Fault Isolation Mathias Payer, ETH Zurich Motivation Applications often vulnerable to security exploits Solution: restrict application

More information

In this Chapter you ll learn:

In this Chapter you ll learn: Now go, write it before them in a table, and note it in a book. Isaiah 30:8 To go beyond is as wrong as to fall short. Confucius Begin at the beginning, and go on till you come to the end: then stop. Lewis

More information

Restraining Execution Environments

Restraining Execution Environments Restraining Execution Environments Segurança em Sistemas Informáticos André Gonçalves Contents Overview Java Virtual Machine: Overview The Basic Parts Security Sandbox Mechanisms Sandbox Memory Native

More information

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 3, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts

More information

Evolution of the Major Programming Languages

Evolution of the Major Programming Languages 142 Evolution of the Major Programming Languages Object Oriented Programming: Smalltalk Object-Oriented: It s fundamental characteristics are: Data abstraction, Inheritance and Dynamic Binding. The essence

More information

Trace-Based and Sample-Based Profiling in Rational Application Developer

Trace-Based and Sample-Based Profiling in Rational Application Developer Trace-Based and Sample-Based Profiling in Rational Application Developer This document is aimed at highlighting the importance of profiling in software development and talks about the profiling tools offered

More information

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1 A feature of Oracle Rdb By Ian Smith Oracle Rdb Relational Technology Group Oracle Corporation 1 Oracle Rdb Journal SQL:1999 and Oracle Rdb V7.1 The

More information

Operating System Structures

Operating System Structures COP 4610: Introduction to Operating Systems (Spring 2015) Operating System Structures Zhi Wang Florida State University Content Operating system services User interface System calls System programs Operating

More information