CSC209H1 Lecture Notes - C Data Types, Type 38 Rifle, Data Type

39 views1 pages
24 Apr 2013
School
Course
Professor

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents