lect02 - CMSC 216 Introduction to Computer Systems Lecture...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 216 Introduction to Computer Systems Lecture 2 Introduction to C Jan Plane & Pete Keleher {jplane, keleher}@cs.umd.edu
Background image of page 1

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

View Full DocumentRight Arrow Icon
Administrivia • Project 1 will be posted soon, due 1.5 weeks later • Read Chapters 2 and 3 of Reek CMSC 216 - Wood, Sussman, Herman, Plane 2
Background image of page 2
D ATA Chapter 3, Reek CMSC 216 - Wood, Sussman, Herman 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
Data types in C • C has four basic types: integers, floating point numbers, pointers, and aggregate types (e.g., arrays and structures) – The first three are considered scalar types • Integers include characters as well as the numbers you commonly think of • Integer types have signed and unsigned versions • Floating point types have (mostly) the same names as in Java: float and double CMSC 216 - Wood, Sussman, Herman 4
Background image of page 4
Data sizes in C Type name Minimum size Size on linux.grace char 1 1 short 2 2 int 2 4 long 4 8 float 4 4 double 8 8 long double 10 12 CMSC 216 - Wood, Sussman, Herman 5 All sizes are in bytes. Note that variables of type char are guaranteed to always be one byte. There is no maximum size for a type, but the following relationships must hold: sizeof(short) <= sizeof(int) <= sizeof(long) sizeof(float) <= sizeof(double) <= sizeof(long double)
Background image of page 5

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

View Full DocumentRight Arrow Icon
Numeric literals • Suffixes allow you to specify a number is of a given
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

lect02 - CMSC 216 Introduction to Computer Systems Lecture...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online