CS 24000 Study Guide - Midterm Guide: Entry Point, In C, Octal

29 views3 pages

Document Summary

Constants: same as java. const double pi = 3. 14192654, constants cannot be changed, also it is common in c to use the c pre- processor to define variables. Assignments: the element in the left side has to be an l-value . An l-value can be interpreted as an address: a variable is an l-value but a constant is not an l-value, x = 5; l-value, 8 = 5; not l-value. In c, an assignment is an expression: this implies that an assignment may appear anywhere an expression is allowed. Example: j = (i = 5) +3; // this will assign 5 to i and it will assign 8 to j: example: while( (c = getchar() ) != -1){ } Integer constants: 1 2 3 4 decimal, 031 octal constant 3*8+1 = 25 starts with 0, 0x4a3 hexadecimal constant 4*16^2+10*16+3= or in binary 0100.

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

Related Documents