CSC209H1 Lecture Notes - C Data Types, Type 38 Rifle, Data Type
Document Summary
C data types: basic types and literals (see king ch7) Integer numbers long has suffix l, oct has prefix 0, hex has prefix 0x. Oct & hex different ways of writing numbers. Output: i = 38, el = 38, hex = 42, oct = 27. Optional exponents preceeded by e (or e), optional +/- Output: d1 = 0. 3, d2 = 3. 00, d3 = 6. 020000e+23: c literals and types. A literal is a constant expressed in code. Int long int int int double float: most things in c are ints: A" is 97, \n" is 10, \033" is 033 and 27: char, int, long, are just different sizes of integers. $ gcc -wall -o datatype datatype. c datatype. c: in function main": datatype. c:32: warning: format %d" expects type. Int", but argument 2 has type long unsigned int" datatype. c:32: warning: format %d" expects type. Int", but argument 2 has type long unsigned int" datatype. c:33: warning: format %d" expects type.