{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

1_Review_Ch_2-1 - CIS 15AG 1 Review Chapter 2 Introduction...

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

View Full Document Right Arrow Icon
CIS 15AG Review Chapter 2: Introduction to the C Language C Language – designed by Dennis Ritchie, at Bell Laboratories, 1972 1972: traditional C 1989: ANSI C (American National Standards Institute) 1990: ISO C (International Standards Organization) 1999: C99 – current standard C Program – consists of one or more functions, one and only one of them must be named main() . Comments – for internal program documentation; are ignored by the compiler Block comment: /* Text to be written on more than one line */ Line comment: // an one line comment Reserved Words – words that have a predefined meaning that cannot be changed, such as if , else , for , do , while , etc. Identifiers – used in a language to name data and other objects, such as area , length , score , stuID , etc. C is case sensitive: tax and TAX are different identifiers. Rules for identifiers: consists of only letters, digits, or '_', the first character must be a letter or '_', it cannot be a reserved word, and the first 63 characters are significant. Choose meaningful identifiers! Type : – a type defines a set of values and a set of operations that can be applied on those values. C Types void – no values, no operations, but very useful: int main( void ) – integral – boolean bool only two values: false 0 true any non-zero value – character char set of values: most computers are using the ASCII alphabet; a character is stored in the memory as an integer, its ASCII code – integer short int 2 bytes: -32,768 to 32,767 int 4 bytes: -2,147,483,648 to 2,147,483,647 long int 4 bytes long long int 8 bytes (19 digits) unsigned short 2 bytes: 0 to 65,535 unsigned int 4 bytes: 0 to 4,294,967,295 – floating-point – real float , double , long double – imaginary (optional) – complex (optional) – derived (later) Variable a named memory location; in addition to its name
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
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