CSE 100 Lecture Notes - Lecture 6: Type Conversion, Standard Error

80 views3 pages

Document Summary

Cse 100 lecture six notes: type conversions, input and output with characters and strings, etc. A method for converting different data types from one form to another. Short x = 350; int y; y = x; This conversion is completed without the use of explicit converters. Class a {}; class b { public: b (a a) {} }; Pointers to any type can be converted to void pointers. Some conversions imply a loss of precision which can trigger a warning. Can be avoided with an explicit conversion. Can also include constructor or operator conversions. Can be applied indiscriminately on classes and pointers to classes. Traditional methods allow to convert any pointer into another pointer type. In order to control conversions between classes, there are four types of conversions. Short x = 350; int y; y = (int) x; y = int (x); Can only be used with pointers and references to objects.

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