Clanguage - C OSMIC Soft ware C Language manual Rev 1.4...

Info icon This preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Copyright © COSMIC Software 1999, 2008 All rights reserved. OSMIC Software C C Language manual Rev. 1.4
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Table of Contents ( i ) Preface Chapter 1 Historical Introduction Chapter 2 C Language Overview C Files ......................................................................................... 5 Lines ..................................................................................... 5 Comments ............................................................................. 6 Trigraphs ............................................................................... 6 Lexical Tokens ............................................................................ 7 Identifiers .............................................................................. 7 Keywords .............................................................................. 7 Constants .............................................................................. 8 Operators and Punctuators .................................................... 8 Declarations ................................................................................ 9 Integer Types ........................................................................ 9 Bit Type .............................................................................. 11 Real Types .......................................................................... 11 Pointers ............................................................................... 12 Arrays ................................................................................. 13 Structures ............................................................................ 13 Unions ................................................................................. 13 Enumerations ...................................................................... 14 Functions ............................................................................ 14 Chapter 3 Declarations Integers ...................................................................................... 16 Reals .......................................................................................... 16 Bits ............................................................................................ 17 Pointers ..................................................................................... 17 Arrays ........................................................................................ 18 Modifiers ................................................................................... 19 Structures .................................................................................. 22 Unions ....................................................................................... 24 Enumerations ............................................................................ 24 Functions ................................................................................... 25 Storage Class ............................................................................. 27
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
( ii ) Typedef ..................................................................................... 29 Variable Scope .......................................................................... 30 Absolute Addressing ................................................................. 30 Chapter 4 Expressions Variables ................................................................................... 32 Constants .................................................................................. 32 Strings ....................................................................................... 35 Sizeof ........................................................................................ 37 Operators .................................................................................. 37 Arithmetic operators ........................................................... 38 Bitwise operators ................................................................ 39 Boolean operators ............................................................... 40 Assignment operators ......................................................... 41 Addressing operators .......................................................... 43 Function call operator ......................................................... 44 Conditional operator ........................................................... 46 Sequence operator .............................................................. 47 Conversion operator ........................................................... 47 Priorities .................................................................................... 49 Chapter 5 Statements Block statement ........................................................................ 54 Expression statement ................................................................ 54 If statement ............................................................................... 55 While statement ........................................................................ 57 Do statement ............................................................................. 58 For statement ............................................................................ 59 Break statement ........................................................................ 61 Continue statement ................................................................... 62 Switch statement ....................................................................... 63 Goto statement .......................................................................... 65 Return statement ....................................................................... 66 Chapter 6 Preprocessor Macro Directives ...................................................................... 70 Hazardous Behaviours ........................................................ 73 Predefined Symbols ............................................................ 75 Conditional Directives .............................................................. 77
Image of page 4
( iii ) Control Directives ..................................................................... 79 #include .............................................................................. 79 #error .................................................................................. 79 #line .................................................................................... 79 #pragma .............................................................................. 80
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
© Copyright 2008 by COSMIC Software 1 Preface Chapter 1, Historical Introduction Chapter 2, C Language Overview - file structure, separate compile - character set (trigraph, logical lines, preprocessor) - naming, identifiers, keywords, operators, punctuation - C objects (simple, aggregate) - functions Chapter 3, Declarations - syntax for each kind of object - modifiers const, volatile - extra modifiers for pointers - function declaration, arguments and local variables - classes and scope - type redeclaration (typedef) Chapter 4, Expressions - identifiers, operators and constants - operators behaviour - conversions, explicit, implicit Chapter 5, Statements - description of each statement Chapter 6, Preprocessor - description of each directives - traps and solutions - pragmas and their usage
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
© Copyright 2008 by COSMIC Software CHAPTER 3 1 Historical Introduction The C language was designed in 1972 at the Bell Lab’s by Denis Ritchie, mainly to rewrite the UNIX operating system in a portable way. UNIX was written originally in assembler and had to be completely rewritten for each new machine. The C language was based on previous languages named B and BCPL, and is logically called C to denote the evolution. The language is described in the well known book “ The C Program- ming Language ” published in 1978, whose “ Appendix A ” has been used for many years as the de facto standard. Because of the growing popu- larity (The popularity) of UNIX and of the C language (growing), sev- eral companies started to provide C compilers outside of the UNIX world, and for a wide range of processors, microprocessors, and even micro-controllers.
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern