CS 24000 Study Guide - Midterm Guide: Bitwise Operation

23 views2 pages

Document Summary

Cast conversion: done by the programmer, (type) expression, (int) 2. 5 results into 2. Typedef typedef provides a synonym of an existing type: typedef int boolean, boolean b; A and a" are different: a is a string constant type (char *) A" is a char constant type (int: if (c = getchar() != eof) is not the same as if ((c = getchar()) != eof) Bitwise operations: or : the | operator executes or bit operation. unsigned x = 0x05; // 00000101 unsigned y = (x | 0x2); // 00000101 | 00000010=00000111 printf( x=0x%x 0x%x\n , x,y); // x=0x5 y=0x7. In your code d = open(/path/to/dir, o_read| o_write); Bitwise operations: and : the & operator executes and bit operation. unsigned x = 0x05; // 00000101 unsigned y =(x & 0x3);// 00000101 & 00000011 =00000001 printf( x=0x%x y=0x%x\n , x,y); // x=0x5 y=0x1.

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