Contents Lecture 3. C Preprocessor, Chapter 11 Declarations, Chapter 8. Jonas Skeppstedt Lecture / 44

Size: px
Start display at page:

Download "Contents Lecture 3. C Preprocessor, Chapter 11 Declarations, Chapter 8. Jonas Skeppstedt Lecture / 44"

Transcription

1 Contents Lecture 3 C Preprocessor, Chapter 11 Declarations, Chapter 8 Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

2 C Preprocessor Predefined macros Macro replacement Conditional inclusion Source file inclusion Line control Error directive Pragma directive Null directive Predefined macro names Pragma operator Jonas Skeppstedt Lecture / 44

3 Predefined macros: standard macros FILE expands to the source file name. LINE expands to the current line number. DATE expands to the date of translation. TIME expands to the time of translation. STDC expands to 1 if the implementation is conforming. STDC_HOSTED expands to 1 if the implementation is hosted, and to 0 if it is free-standing. STDC_VERSION expands to L. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

4 Predefined macros: implementation-defined STDC_IEC_559 expands to 1 if IEC 60559/IEEE 754 is supported (except complex arithmetic). STDC_IEC_559_COMPLEX expands to 1 if complex arithmetic in IEC 60559/IEEE 754 is supported. STDC_ISO_10646 expands to an integer yyyymml to indicate which values of wchar_t are supported. If a predefined macro is undefined then behaviour is undefined. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

5 Defining macros #define obj (a) a+1 #define bad(a) a+1 #define good(a) (a+1) obj(3) => (a) a+1(3) bad(3)*10 => 3+1*10 good(3)*10 => (3+1)*10 (good)(3)*10 => (good)(3)*10 No whitespace between macro name and left parenthesis in function-like macro. A funcion-like macro not followed by left paranthesis is not expanded. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

6 Conditional inclusion #define DEBUG #ifdef DEBUG printf("here we go: %s %d\n", FILE, LINE ); #endif #ifndef DEBUG #endif #if expr1 #elif expr2 #elif expr3 #else #endif Jonas Skeppstedt Lecture / 44

7 More directives #define DEBUG 12 #define DEBUG 13 #undef DEBUG #define DEBUG 13 #line 9999 "a.c" #endif // invalid : cannot redefine a macro // OK. undefined f i r s t // w i l l set LINE and FILE #ifndef STDC #error this code will not work with a pre-ansi compiler! #endif #pragma directive from user to compiler _Pragma("directive from user to compiler") Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

8 # operator stringizer Operator # must precede a macro parameter and it expands to a string. #define xstr(a) #a #define str(b) xstr(b) #define c 12 xstr(c) => "c" str(c) => "12" #define fatal(expr) { \ fprintf(stderr, "%s line %d in \"%s\": fatal error %s = %d\n", \ FILE, LINE, func, #expr, expr); exit(1); } int x = 2; fatal(x); => prog.c line 15 in "main": fatal error x = 2 Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

9 ## operator Operator ## concatenates the tokens to the left and right. #define name(id, type) id##type name(x,int) => xint #define a x ## y #define xy 12 #int b = a; // i n i t i a l i s e s b to 12; Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

10 VA_ARGS Sometimes it is convenient to a have a variable number of arguments to a function-like macro, eg when using printf. Without VA_ARGS, the number of arguments must match the number of parameters. #ifdef DEBUG #define pr(...) fprintf(stderr, VA_ARGS ); #else #define pr(...) / do nothing. / #endif int x = 1, y = 3; pr("x = %d, y = %d\n", x, y); => x = 1, y = 3 Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

11 What is meant by declarations??? A declaration associates an identifier with one of variable, function, or type. For example: int a; int a, *b, free(void*); int* b; typedef int integer; int free(void* ptr); typedef int integer; One declaration can have multiple variables and functions. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

12 Names spaces Variables, types (typedef names) and functions belong to the same name space. Struct tags are in a separate namespace. typedef int a; a a; // error : redeclaration of a struct x { int y; } z; // tag x, f i e l d y, variable z struct s { int s; } s; // OK. Labels are in a separate name space as well: void f() { goto f; // not a function c a l l! f: printf("hello\n"); // target of the goto. } Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

13 Class names in C++ and Java In Java and C++, you can do the following (although with different meaning in Java and C++): class a { int b; int c; }; a d; The class name becomes available as a type. Not so in C. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

14 Declaring a struct typedef name struct a { int b; int c; }; struct a d; In C you can write struct a (ie struct tag variable). Since writing struct many times becomes tedious, there is a shorter form. In fact we can skip the tag a: typedef struct a { typedef struct { int b; int b; int c; int c; } a; } a; a d; Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

15 Self-referential structs such as lists We cannot write like this: typedef struct list_t { list_t* next; // error int data; } list_t; The shorthand (or typedef name) list_t is declared at the last line so it can not be used before that point. We will next see how to deal with that problem. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

16 Correct declaration of a list typedef struct list_t struct list_t { list_t* int }; list_t; next; data; Or: typedef struct list_t { struct list_t* int } list_t; next; data; Either way is fine but first more common. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

17 Two kinds of variables Stack variables only exist while the function is being executed. Variables with static storage duration exist while the program is being executed. Global variables, declared outside the scope of a function, have static storage duration. A local variable is declared inside a function. If a local variable has the keyword static before the type, it also has static storage duration. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

18 Illustration of the previous slide int a; // Global variable A visible in all f i l e s. static int b; // Global variable B visible only in this f i l e. int f(int c) // Stack variable C. { static int d; // Local variable D with static storage duration. int e; // Stack variable E. } d = d + 1; // Value of D i s remembered between calls! e = a + b + c + d; return e; Due to the static, the value of d will be remembered for the next call to f. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

19 Consequences of different variable s lifetimes A stack variable only needs memory a short time. Variables with static storage duration use memory for the whole program. The address of a global variable is always valid. The address of a stack variable is meaningless when the function has returned. Avoid using global variables, since they complicate understanding the program. If a global variable only needs to be visible in one file, then use static. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

20 Storage classes There are four storage class specifiers: extern default for global variables and makes them visible in other files. static static storage duration and visible only within its scope. auto automatic storage duration ie what already is default for local variables and hence rarely used. register tells the compiler this variable should if possible be stored in a register to make accessing it faster. Usually ignored by compilers. However, with this storage class, the address cannot be taken (since the variable is supposed to have none). A fifth _Thread_local is new in C11 the current ISO C Standard but will not be discussed in this course (see EDAN25). Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

21 Declaring vs defining global variables Declaring a global variable means to inform the compiler that a certain variable exists with a type and a name. It does not mean asking the compiler to reserve memory for it. Defining a global variable means declaring the variable and telling the compiler to reserve memory for it. If we want to define a global variable and thus making sure its address is here, we have to give it an initial value: int a = 12; // correct extern int b = 12; // not portable. some compilers accept i t. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

22 More about global variables memory If we just want to declare a global variable but not reserving memory for it, we use extern: extern int a; If we want to declare a global variable and don t mind reserving memory for it, we skip extern: int a; Skipping extern has the effect that if no where else in the program the variable has been defined with an initial value, then the compiler will reserve memory for it. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

23 Wrong declaration 1 file a.c file b.c extern int x; extern int x; int main() { printf("x = %d\n", x); return 0; } The compiler will complain that x is not defined (anywhere). Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

24 Wrong declaration 2 file a.c file b.c int x = 1; int x = 1; int main() { printf("x = %d\n", x); return 0; } The compiler will complain that x is defined multiple times. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

25 Correct declaration 1 file a.c file b.c int x = 1; extern int x; int main() { printf("x = %d\n", x); return 0; } The compiler will reserve memory for x in file a.c. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

26 Correct declaration 2 file a.c file b.c int x; extern int x; int main() { printf("x = %d\n", x); return 0; } The compiler will reserve memory for x somewhere but not in these files. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

27 Correct declaration 3 file a.c file b.c int x; int x; int main() { printf("x = %d\n", x); return 0; } The compiler will reserve memory for x somewhere but not in these files. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

28 Correct declaration 4 file a.c file b.c file globals.h #include "globals.h" #include "globals.h" extern int x; int x; int main() { // use x // use x } Declare all global variables of an application in a file globals.h and include it when needed. The same applies to abstract data types such as lists. Put the type and function declarations in a header file. Sometimes only the typedef and function declarations are put in the public header file and the struct declarations in a private header file. More about that later. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

29 One more detail: mixing static and extern The following which no one would ever write is valid and well defined: static int a; extern int a; // OK. A remains static. The following, however, which happens quite often is not valid and is a dangerous error (technically, a so called undefined behaviour, or UB). extern int f(); static int f() { return 1; } Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

30 How to accidently make the previous error int main() { f(); } static int f() { return 1; } Before C99 calling an unknown function implicitly declared it to return an int and have storage class extern. In C99 the above should be rejected since f has not been declared, but many C99 compiler usually only issue a warning. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

31 Initial values in declarations The content of a stack variable is what that memory location happended to be used for most recently, ie the value is undefined. Variables with static storage duration are by default set to zero. A variable declaration can give the variable an initial value: int a = 12; // must be a constant expression int *b = &a; // &a i s constant since a has static storage void f() { int c[2] = { 1, 2 }; // OK int d = rand(); // non constant i s OK. } Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

32 More initialisations For structs and arrays, fields or elements not explicitly given a value become zero. C99 permits more control over initialisations: struct { int a; int b; inc c; } s = {.b = 13, 14 }; // a=0,b=13,c=14 int a [10] = { [3] = 12, 14 }; // a [3] = 12, a [4] = 14 One may wonder why this has been introduced in the language, but it reduces the risk of making annoying errors as shown next. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

33 Initialising complex data structures before C99 // Countries in alphabetical order. enum country_t { AUSTRIA, FRANCE, GERMANY, SWEDEN }; char* capital[] = { "Vienna" "Paris", "Berlin", "Stockholm", }; Suppose we wish to add ITALY and "Rome". The order of the capitals depends on the enum and we must make sure the strings are put in the proper order. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

34 Adding an item Now suppose we wish to add Italy. Not too much trouble but there is a risk of making an error when editing the capital array, which can be avoided with the designated initialisers: enum country_t { AUSTRIA, FRANCE, GERMANY, ITALY, SWEDEN }; char* capital[] = { [FRANCE] = "Paris", [ITALY] = "Rome", [AUSTRIA] = "Vienna" [GERMANY] = "Berlin", [SWEDEN] = "Stockholm", }; Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

35 Volatile qualifier #include <signal.h> volatile int x; void catch_ctrl_c(int sig) // called when you hit CTRL C. { x = 0; } int main() // below line will t e l l your computer to call the { // function catch_ctrl_c when you hit CTRL C. signal(sigint, catch_ctrl_c); x = 1; while (x) // when compiling with optimisation and without ; // volatile, GCC thinks X cannot change! } Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

36 Const and restrict qualifiers The const qualifier informs the compiler it can put a variable in read-only memory. Only an initialisation is permitted. The restrict qualifier informs the compiler that two parameters can not point to the same memory area. This is new in C99 and its purpose is to tell the compiler some advanced tricks are legal. void f(restrict int* a, restrict int* b, int n) { int i; for (i = 1; i < n-1; i++) a[i] = 2 * b[i-1] + 3 * b[i] + 4 * b[i+1]; } Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

37 Type specifiers: basic types 1(2) The type specifiers are: void, char, short, int, long, float, double, signed, unsigned, _Bool, _Complex, _Imaginary, struct-or-union, enum-specifier, and typedef-name. The type specifiers are combined into lists including signed char, unsigned char, char, signed long long and long double. Note that signed char, unsigned char, and char all are different types: char behaves like one of the other two (which is implementation-defined) but it is a distinct type. char* s; unsigned char* t = s; // invalid. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

38 Type specifiers: basic types 2(2) _Bool a; #include <stdbool.h> bool b; The type _Bool is new in C99. <stdbool.h> defines bool as a macro which expands to _Bool. A bool can only take the values zero and one. An assignment to a bool variable stores a one if the expression is not zero. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

39 Type specifiers: structs and unions struct s { int a; // OK. int b:1; // OK, but signedness impl. def. signed int c:1; // OK, one signed bit. unsigned int d:1; // OK, one unsigned bit. _Bool e:1; // OK. car_t f:2; // OK i f implementation permits. int g(int, int); // No, not in C. int (*h)(int, int); // OK. Pointer to function. int i[0]; // No (but valid in GCC). int j[]; // OK i f last member in C99 }; Avoid using plain int as bitfield type. Specify whether it is signed or not. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

40 Declarators: Type constructors There are three type constructors: Array Function Pointer Array and Function have higher precedece than Pointer Place array dimension or the function s parenthesis to the right of the declarator and a star before the declarator Confusion arises because the type cannot be read from left to right but must be read from inside to the outside : int (*a[12])(int);. What is the type of a? Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

41 Declarators: Examples int a; // int int *b; // pointer to int int **c; // pointer to pointer to int int d[4]; // array of int int e[4][5]; // array of array of int int *f[4]; // array of pointers int (*g[4])[5]; // array of pointers to array of int int *h(); // function returning pointer to int int (*i)(); // pointer to function returning int int *j()(); // NO: func returning func returning pointer to int int (*k())(); // func returning pointer to func returning int A function cannot return a function or an array, only pointers to them. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

42 Arithmetic Conversions Conversions occur in expressions when operands of two different types eg are added together. double x; int a; long b; b = a + x; // OK. First a is converted to a double, and then the result is converted to a long. Arithmetic types can be mixed. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

43 Explicit conversion using a cast Sometimes we want to convert a variable into another type. double x; int numerator; int denominator; x = numerator / denominator; // integer divide. x = numerator / (double)denominator; // cast i s needed. Since the value of the denominator has type double, the division must be performed in type double and the result is as expected. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

44 Assignment conversions Recall that a pointer to void can point to any data object (but not to functions). char* signed char* int* long* void* cp; scp; ip; lp; vp; vp = ip; // OK. void pointer always ok. ip = vp; // OK. void pointer always ok. ip = lp; // Always wrong to mix non void pointer types. cp = scp; // No: char and signed char are different types. Jonas Skeppstedt (js@cs.lth.se) Lecture / 44

Contents of Lecture 3

Contents of Lecture 3 Contents of Lecture 3 Repetition of matrices double a[3][4]; double* b; double** c; Terminology Linkage Types Conversions Jonas Skeppstedt (js@cs.lth.se) Lecture 3 2014 1 / 33 A global matrix: double a[3][4]

More information

COMP322 - Introduction to C++ Lecture 02 - Basics of C++

COMP322 - Introduction to C++ Lecture 02 - Basics of C++ COMP322 - Introduction to C++ Lecture 02 - Basics of C++ School of Computer Science 16 January 2012 C++ basics - Arithmetic operators Where possible, C++ will automatically convert among the basic types.

More information

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above P.G.TRB - COMPUTER SCIENCE Total Marks : 50 Time : 30 Minutes 1. C was primarily developed as a a)systems programming language b) general purpose language c) data processing language d) none of the above

More information

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites:

C Programming. Course Outline. C Programming. Code: MBD101. Duration: 10 Hours. Prerequisites: C Programming Code: MBD101 Duration: 10 Hours Prerequisites: You are a computer science Professional/ graduate student You can execute Linux/UNIX commands You know how to use a text-editing tool You should

More information

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things.

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things. A Appendix Grammar There is no worse danger for a teacher than to teach words instead of things. Marc Block Introduction keywords lexical conventions programs expressions statements declarations declarators

More information

Tokens, Expressions and Control Structures

Tokens, Expressions and Control Structures 3 Tokens, Expressions and Control Structures Tokens Keywords Identifiers Data types User-defined types Derived types Symbolic constants Declaration of variables Initialization Reference variables Type

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

Topic 6: A Quick Intro To C. Reading. "goto Considered Harmful" History

Topic 6: A Quick Intro To C. Reading. goto Considered Harmful History Topic 6: A Quick Intro To C Reading Assumption: All of you know basic Java. Much of C syntax is the same. Also: Some of you have used C or C++. Goal for this topic: you can write & run a simple C program

More information

QUIZ. What are 3 differences between C and C++ const variables?

QUIZ. What are 3 differences between C and C++ const variables? QUIZ What are 3 differences between C and C++ const variables? Solution QUIZ Source: http://stackoverflow.com/questions/17349387/scope-of-macros-in-c Solution The C/C++ preprocessor substitutes mechanically,

More information

QUIZ. What is wrong with this code that uses default arguments?

QUIZ. What is wrong with this code that uses default arguments? QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code

More information

Axivion Bauhaus Suite Technical Factsheet MISRA

Axivion Bauhaus Suite Technical Factsheet MISRA MISRA Contents 1. C... 2 1. Misra C 2004... 2 2. Misra C 2012 (including Amendment 1). 10 3. Misra C 2012 Directives... 18 2. C++... 19 4. Misra C++ 2008... 19 1 / 31 1. C 1. Misra C 2004 MISRA Rule Severity

More information

G52CPP C++ Programming Lecture 8. Dr Jason Atkin

G52CPP C++ Programming Lecture 8. Dr Jason Atkin G52CPP C++ Programming Lecture 8 Dr Jason Atkin 1 Last lecture Dynamic memory allocation Memory re-allocation to grow arrays Linked lists Use -> rather than. pcurrent = pcurrent -> pnext; 2 Aside: do not

More information

MISRA-C:2012 Standards Model Summary for C / C++

MISRA-C:2012 Standards Model Summary for C / C++ Version 9.7.1 Copyright 2017 Ltd. MISRA-C:2012 s Model Summary for C / C++ The tool suite is developed and certified to BS EN ISO 9001:2000 and SGS-TÜV Saar. This information is applicable to version 9.7.1

More information

Review of the C Programming Language for Principles of Operating Systems

Review of the C Programming Language for Principles of Operating Systems Review of the C Programming Language for Principles of Operating Systems Prof. James L. Frankel Harvard University Version of 7:26 PM 4-Sep-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights

More information

#include. Practical C Issues: #define. #define Macros. Example. #if

#include. Practical C Issues: #define. #define Macros. Example. #if #include Practical C Issues: Preprocessor Directives, Typedefs, Multi-file Development, and Makefiles Jonathan Misurda jmisurda@cs.pitt.edu Copies the contents of the specified file into the current file

More information

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 C: Linked list, casts, the rest of the preprocessor (Thanks to Hal Perkins)

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 C: Linked list, casts, the rest of the preprocessor (Thanks to Hal Perkins) CSE 374 Programming Concepts & Tools Brandon Myers Winter 2015 C: Linked list, casts, the rest of the preprocessor (Thanks to Hal Perkins) Linked lists, trees, and friends Very, very common data structures

More information

Basic Types, Variables, Literals, Constants

Basic Types, Variables, Literals, Constants Basic Types, Variables, Literals, Constants What is in a Word? A byte is the basic addressable unit of memory in RAM Typically it is 8 bits (octet) But some machines had 7, or 9, or... A word is the basic

More information

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary

Computer Science & Information Technology (CS) Rank under AIR 100. Examination Oriented Theory, Practice Set Key concepts, Analysis & Summary GATE- 2016-17 Postal Correspondence 1 C-Programming Computer Science & Information Technology (CS) 20 Rank under AIR 100 Postal Correspondence Examination Oriented Theory, Practice Set Key concepts, Analysis

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

Have examined process Creating program Have developed program Written in C Source code

Have examined process Creating program Have developed program Written in C Source code Preprocessing, Compiling, Assembling, and Linking Introduction In this lesson will examine Architecture of C program Introduce C preprocessor and preprocessor directives How to use preprocessor s directives

More information

Ch. 3: The C in C++ - Continued -

Ch. 3: The C in C++ - Continued - Ch. 3: The C in C++ - Continued - QUIZ What are the 3 ways a reference can be passed to a C++ function? QUIZ True or false: References behave like constant pointers with automatic dereferencing. QUIZ What

More information

IAR Embedded Workbench MISRA C:2004. Reference Guide

IAR Embedded Workbench MISRA C:2004. Reference Guide IAR Embedded Workbench MISRA C:2004 Reference Guide COPYRIGHT NOTICE Copyright 2004 2008 IAR Systems. All rights reserved. No part of this document may be reproduced without the prior written consent of

More information

COMP322 - Introduction to C++

COMP322 - Introduction to C++ COMP322 - Introduction to C++ Winter 2011 Lecture 2 - Language Basics Milena Scaccia School of Computer Science McGill University January 11, 2011 Course Web Tools Announcements, Lecture Notes, Assignments

More information

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS Contents Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS 1.1. INTRODUCTION TO COMPUTERS... 1 1.2. HISTORY OF C & C++... 3 1.3. DESIGN, DEVELOPMENT AND EXECUTION OF A PROGRAM... 3 1.4 TESTING OF PROGRAMS...

More information

CODE TIME TECHNOLOGIES. Abassi RTOS MISRA-C:2004. Compliance Report

CODE TIME TECHNOLOGIES. Abassi RTOS MISRA-C:2004. Compliance Report CODE TIME TECHNOLOGIES Abassi RTOS MISRA-C:2004 Compliance Report Copyright Information This document is copyright Code Time Technologies Inc. 2012. All rights reserved. No part of this document may be

More information

Chapter 7: Preprocessing Directives

Chapter 7: Preprocessing Directives Chapter 7: Preprocessing Directives Outline We will only cover these topics in Chapter 7, the remain ones are optional. Introduction Symbolic Constants and Macros Source File Inclusion Conditional Compilation

More information

Topic 6: A Quick Intro To C

Topic 6: A Quick Intro To C Topic 6: A Quick Intro To C Assumption: All of you know Java. Much of C syntax is the same. Also: Many of you have used C or C++. Goal for this topic: you can write & run a simple C program basic functions

More information

EL6483: Brief Overview of C Programming Language

EL6483: Brief Overview of C Programming Language EL6483: Brief Overview of C Programming Language EL6483 Spring 2016 EL6483 EL6483: Brief Overview of C Programming Language Spring 2016 1 / 30 Preprocessor macros, Syntax for comments Macro definitions

More information

BLM2031 Structured Programming. Zeyneb KURT

BLM2031 Structured Programming. Zeyneb KURT BLM2031 Structured Programming Zeyneb KURT 1 Contact Contact info office : D-219 e-mail zeynebkurt@gmail.com, zeyneb@ce.yildiz.edu.tr When to contact e-mail first, take an appointment What to expect help

More information

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor CS 261 Fall 2017 Mike Lam, Professor C Introduction Variables, Memory Model, Pointers, and Debugging The C Language Systems language originally developed for Unix Imperative, compiled language with static

More information

Review of the C Programming Language

Review of the C Programming Language Review of the C Programming Language Prof. James L. Frankel Harvard University Version of 11:55 AM 22-Apr-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reference Manual for the

More information

Instantiation of Template class

Instantiation of Template class Class Templates Templates are like advanced macros. They are useful for building new classes that depend on already existing user defined classes or built-in types. Example: stack of int or stack of double

More information

Why Pointers. Pointers. Pointer Declaration. Two Pointer Operators. What Are Pointers? Memory address POINTERVariable Contents ...

Why Pointers. Pointers. Pointer Declaration. Two Pointer Operators. What Are Pointers? Memory address POINTERVariable Contents ... Why Pointers Pointers They provide the means by which functions can modify arguments in the calling function. They support dynamic memory allocation. They provide support for dynamic data structures, such

More information

The New C Standard (Excerpted material)

The New C Standard (Excerpted material) The New C Standard (Excerpted material) An Economic and Cultural Derek M. Jones derek@knosof.co.uk Copyright 2002-2008 Derek M. Jones. All rights reserved. 1378 type specifier type-specifier: void char

More information

C Fundamentals & Formatted Input/Output. adopted from KNK C Programming : A Modern Approach

C Fundamentals & Formatted Input/Output. adopted from KNK C Programming : A Modern Approach C Fundamentals & Formatted Input/Output adopted from KNK C Programming : A Modern Approach C Fundamentals 2 Program: Printing a Pun The file name doesn t matter, but the.c extension is often required.

More information

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below: QUIZ 1. Explain the meaning of the angle brackets in the declaration of v below: This is a template, used for generic programming! QUIZ 2. Why is the vector class called a container? 3. Explain how the

More information

G52CPP C++ Programming Lecture 6. Dr Jason Atkin

G52CPP C++ Programming Lecture 6. Dr Jason Atkin G52CPP C++ Programming Lecture 6 Dr Jason Atkin 1 Last lecture The Stack Lifetime of local variables Global variables Static local variables const (briefly) 2 Visibility is different from lifetime Just

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

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language 1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

More information

Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks

Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks Goanna 3.3.2 Standards Data Sheet for MISRA C:2012 misrac2012-datasheet.pdf Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks The following

More information

CS Programming In C

CS Programming In C CS 24000 - Programming In C Week Two: Basic C Program Organization and Data Types Zhiyuan Li Department of Computer Science Purdue University, USA 2 int main() { } return 0; The Simplest C Program C programs

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Data Types Basic Types Enumerated types The type void Derived types

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

Appendix A. The Preprocessor

Appendix A. The Preprocessor Appendix A The Preprocessor The preprocessor is that part of the compiler that performs various text manipulations on your program prior to the actual translation of your source code into object code.

More information

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW IMPORTANT QUESTIONS IN C FOR THE INTERVIEW 1. What is a header file? Header file is a simple text file which contains prototypes of all in-built functions, predefined variables and symbolic constants.

More information

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead.

Rule 1-3: Use white space to break a function into paragraphs. Rule 1-5: Avoid very long statements. Use multiple shorter statements instead. Chapter 9: Rules Chapter 1:Style and Program Organization Rule 1-1: Organize programs for readability, just as you would expect an author to organize a book. Rule 1-2: Divide each module up into a public

More information

ANSI C Changes. Jonathan Hoyle Eastman Kodak 10/5/00

ANSI C Changes. Jonathan Hoyle Eastman Kodak 10/5/00 ANSI C Changes Jonathan Hoyle Eastman Kodak 10/5/00 ANSI C Changes Introduction Changes to C in conformance to C++ New additions to C friendly to C++ New additions to C unfriendly to C++ What has not changed

More information

Axivion Bauhaus Suite Technical Factsheet AUTOSAR

Axivion Bauhaus Suite Technical Factsheet AUTOSAR Version 6.9.1 upwards Axivion Bauhaus Suite Technical Factsheet AUTOSAR Version 6.9.1 upwards Contents 1. C++... 2 1. Autosar C++14 Guidelines (AUTOSAR 17.03)... 2 2. Autosar C++14 Guidelines (AUTOSAR

More information

C Syntax Out: 15 September, 1995

C Syntax Out: 15 September, 1995 Burt Rosenberg Math 220/317: Programming II/Data Structures 1 C Syntax Out: 15 September, 1995 Constants. Integer such as 1, 0, 14, 0x0A. Characters such as A, B, \0. Strings such as "Hello World!\n",

More information

Lecture 10: building large projects, beginning C++, C++ and structs

Lecture 10: building large projects, beginning C++, C++ and structs CIS 330: / / / / (_) / / / / _/_/ / / / / / \/ / /_/ / `/ \/ / / / _/_// / / / / /_ / /_/ / / / / /> < / /_/ / / / / /_/ / / / /_/ / / / / / \ /_/ /_/_/_/ _ \,_/_/ /_/\,_/ \ /_/ \ //_/ /_/ Lecture 10:

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information

Gabriel Hugh Elkaim Spring CMPE 013/L: C Programming. CMPE 013/L: C Programming

Gabriel Hugh Elkaim Spring CMPE 013/L: C Programming. CMPE 013/L: C Programming 1 2 CMPE 013/L Pre Processor Commands Gabriel Hugh Elkaim Spring 2013 3 Introduction Preprocessing Affect program preprocessing and execution Capabilities Inclusion of additional C source files Definition

More information

C Introduction. Comparison w/ Java, Memory Model, and Pointers

C Introduction. Comparison w/ Java, Memory Model, and Pointers CS 261 Fall 2018 Mike Lam, Professor C Introduction Comparison w/ Java, Memory Model, and Pointers Please go to socrative.com on your phone or laptop, choose student login and join room LAMJMU The C Language

More information

COSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22

COSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22 COSC 2P91 Bringing it all together... Week 4b Brock University Brock University (Week 4b) Bringing it all together... 1 / 22 A note on practicality and program design... Writing a single, monolithic source

More information

CE221 Programming in C++ Part 1 Introduction

CE221 Programming in C++ Part 1 Introduction CE221 Programming in C++ Part 1 Introduction 06/10/2017 CE221 Part 1 1 Module Schedule There are two lectures (Monday 13.00-13.50 and Tuesday 11.00-11.50) each week in the autumn term, and a 2-hour lab

More information

Operator overloading

Operator overloading 1 Introduction 2 The copy constructor 3 Operator Overloading 4 Eg 1: Adding two vectors 5 The -> operator 6 The this pointer 7 Overloading = 8 Unary operators 9 Overloading for the matrix class 10 The

More information

PIC 10A Objects/Classes

PIC 10A Objects/Classes PIC 10A Objects/Classes Ernest Ryu UCLA Mathematics Last edited: November 13, 2017 User-defined types In C++, we can define our own custom types. Object is synonymous to variable, and class is synonymous

More information

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING OBJECT ORIENTED PROGRAMMING STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING 1. Object Oriented Programming Paradigms 2. Comparison of Programming Paradigms 3. Basic Object Oriented Programming

More information

CSE 374 Programming Concepts & Tools

CSE 374 Programming Concepts & Tools CSE 374 Programming Concepts & Tools Hal Perkins Fall 2017 Lecture 8 C: Miscellanea Control, Declarations, Preprocessor, printf/scanf 1 The story so far The low-level execution model of a process (one

More information

edunepal_info

edunepal_info facebook.com/edunepal.info @ edunepal_info C interview questions (1 125) C interview questions are given with the answers in this website. We have given C interview questions faced by freshers and experienced

More information

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9 Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Uppercase Alphabets Lowercase Alphabets Character Set A, B, C, Y, Z a, b, c, y, z Digits

More information

A brief introduction to C programming for Java programmers

A brief introduction to C programming for Java programmers A brief introduction to C programming for Java programmers Sven Gestegård Robertz September 2017 There are many similarities between Java and C. The syntax in Java is basically

More information

Macros and Preprocessor. CGS 3460, Lecture 39 Apr 17, 2006 Hen-I Yang

Macros and Preprocessor. CGS 3460, Lecture 39 Apr 17, 2006 Hen-I Yang Macros and Preprocessor CGS 3460, Lecture 39 Apr 17, 2006 Hen-I Yang Previously Operations on Linked list (Create and Insert) Agenda Linked List (More insert, lookup and delete) Preprocessor Linked List

More information

Declaration Syntax. Declarations. Declarators. Declaration Specifiers. Declaration Examples. Declaration Examples. Declarators include:

Declaration Syntax. Declarations. Declarators. Declaration Specifiers. Declaration Examples. Declaration Examples. Declarators include: Declarations Based on slides from K. N. King Declaration Syntax General form of a declaration: declaration-specifiers declarators ; Declaration specifiers describe the properties of the variables or functions

More information

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level

More information

G52CPP C++ Programming Lecture 9

G52CPP C++ Programming Lecture 9 G52CPP C++ Programming Lecture 9 Dr Jason Atkin http://www.cs.nott.ac.uk/~jaa/cpp/ g52cpp.html 1 Last lecture const Constants, including pointers The C pre-processor And macros Compiling and linking And

More information

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14 C introduction Variables Variables 1 / 14 Contents Variables Data types Variable I/O Variables 2 / 14 Usage Declaration: t y p e i d e n t i f i e r ; Assignment: i d e n t i f i e r = v a l u e ; Definition

More information

Everything Else C Programming and Software Tools. N.C. State Department of Computer Science

Everything Else C Programming and Software Tools. N.C. State Department of Computer Science Everything Else C Programming and Software Tools N.C. State Department of Computer Science BOOLEANS CSC230: C and Software Tools NC State University Computer Science Faculty 2 Booleans In C99, bools are

More information

OBJECT ORIENTED PROGRAMMING USING C++

OBJECT ORIENTED PROGRAMMING USING C++ OBJECT ORIENTED PROGRAMMING USING C++ Chapter 17 - The Preprocessor Outline 17.1 Introduction 17.2 The #include Preprocessor Directive 17.3 The #define Preprocessor Directive: Symbolic Constants 17.4 The

More information

HW1 due Monday by 9:30am Assignment online, submission details to come

HW1 due Monday by 9:30am Assignment online, submission details to come inst.eecs.berkeley.edu/~cs61c CS61CL : Machine Structures Lecture #2 - C Pointers and Arrays Administrivia Buggy Start Lab schedule, lab machines, HW0 due tomorrow in lab 2009-06-24 HW1 due Monday by 9:30am

More information

Creating a C++ Program

Creating a C++ Program Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

More information

5.Coding for 64-Bit Programs

5.Coding for 64-Bit Programs Chapter 5 5.Coding for 64-Bit Programs This chapter provides information about ways to write/update your code so that you can take advantage of the Silicon Graphics implementation of the IRIX 64-bit operating

More information

QUIZ How do we implement run-time constants and. compile-time constants inside classes?

QUIZ How do we implement run-time constants and. compile-time constants inside classes? QUIZ How do we implement run-time constants and compile-time constants inside classes? Compile-time constants in classes The static keyword inside a class means there s only one instance, regardless of

More information

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Why C? Test on 21 Android Devices with 32-bits and 64-bits processors and different versions

More information

ME240 Computation for Mechanical Engineering. Lecture 4. C++ Data Types

ME240 Computation for Mechanical Engineering. Lecture 4. C++ Data Types ME240 Computation for Mechanical Engineering Lecture 4 C++ Data Types Introduction In this lecture we will learn some fundamental elements of C++: Introduction Data Types Identifiers Variables Constants

More information

Basic Types and Formatted I/O

Basic Types and Formatted I/O Basic Types and Formatted I/O C Variables Names (1) Variable Names Names may contain letters, digits and underscores The first character must be a letter or an underscore. the underscore can be used but

More information

QUIZ. Source:

QUIZ. Source: QUIZ Source: http://stackoverflow.com/questions/17349387/scope-of-macros-in-c Ch. 4: Data Abstraction The only way to get massive increases in productivity is to leverage off other people s code. That

More information

CS 211 Programming Practicum Fall 2018

CS 211 Programming Practicum Fall 2018 Due: Wednesday, 11/7/18 at 11:59 pm Infix Expression Evaluator Programming Project 5 For this lab, write a C++ program that will evaluate an infix expression. The algorithm REQUIRED for this program will

More information

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and

Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and Writing an ANSI C Program Getting Ready to Program A First Program Variables, Expressions, and Assignments Initialization The Use of #define and #include The Use of printf() and scanf() The Use of printf()

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

C: How to Program. Week /Mar/05

C: How to Program. Week /Mar/05 1 C: How to Program Week 2 2007/Mar/05 Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers

More information

CSE 333 Autumn 2013 Midterm

CSE 333 Autumn 2013 Midterm CSE 333 Autumn 2013 Midterm Please do not read beyond this cover page until told to start. A question involving what could be either C or C++ is about C, unless it explicitly states that it is about C++.

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

Administrivia. Introduction to Computer Systems. Pointers, cont. Pointer example, again POINTERS. Project 2 posted, due October 6

Administrivia. Introduction to Computer Systems. Pointers, cont. Pointer example, again POINTERS. Project 2 posted, due October 6 CMSC 313 Introduction to Computer Systems Lecture 8 Pointers, cont. Alan Sussman als@cs.umd.edu Administrivia Project 2 posted, due October 6 public tests s posted Quiz on Wed. in discussion up to pointers

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 11: Structures and Memory (yaseminb@kth.se) Overview Overview Lecture 11: Structures and Memory Structures Continued Memory Allocation Lecture 11: Structures and Memory Structures Continued Memory

More information

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

More information

A Fast Review of C Essentials Part II

A Fast Review of C Essentials Part II A Fast Review of C Essentials Part II Structural Programming by Z. Cihan TAYSI Outline Fixed vs. Automatic duration Scope Global variables The register specifier Storage classes Dynamic memory allocation

More information

Fast Introduction to Object Oriented Programming and C++

Fast Introduction to Object Oriented Programming and C++ Fast Introduction to Object Oriented Programming and C++ Daniel G. Aliaga Note: a compilation of slides from Jacques de Wet, Ohio State University, Chad Willwerth, and Daniel Aliaga. Outline Programming

More information

PROGRAMMAZIONE I A.A. 2018/2019

PROGRAMMAZIONE I A.A. 2018/2019 PROGRAMMAZIONE I A.A. 2018/2019 COMMENTS COMMENTS There are two ways to insert a comment in C: üblock comments begin with /* and end with */, and üline comments begin with // and end with the next new

More information

CS3157: Advanced Programming. Outline

CS3157: Advanced Programming. Outline CS3157: Advanced Programming Lecture #12 Apr 3 Shlomo Hershkop shlomo@cs.columbia.edu 1 Outline Intro CPP Boring stuff: Language basics: identifiers, data types, operators, type conversions, branching

More information

Princeton University COS 333: Advanced Programming Techniques A Subset of C90

Princeton University COS 333: Advanced Programming Techniques A Subset of C90 Princeton University COS 333: Advanced Programming Techniques A Subset of C90 Program Structure /* Print "hello, world" to stdout. Return 0. */ { printf("hello, world\n"); -----------------------------------------------------------------------------------

More information

Chapter 1 & 2 Introduction to C Language

Chapter 1 & 2 Introduction to C Language 1 Chapter 1 & 2 Introduction to C Language Copyright 2007 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 1 & 2 - Introduction to C Language 2 Outline 1.1 The History

More information

M.EC201 Programming language

M.EC201 Programming language Power Engineering School M.EC201 Programming language Lecture 13 Lecturer: Prof. Dr. T.Uranchimeg Agenda The union Keyword typedef and Structures What Is Scope? External Variables 2 The union Keyword The

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

More information

Introduction to Programming

Introduction to Programming Introduction to Programming session 6 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Spring 2011 These slides are created using Deitel s slides Sharif University of Technology Outlines

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information