This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: can be just a simple constant or variable); ● returned value value computed by the function the_root = sqrt(9.0); ● function call ( function invocation )  expression consisting of function name followed by arguments in parentheses ● function accepts parameters of certain type and returns value of certain type; sqrt accepts and returns double ● to use a function need to specify include directive: #include <cmath> Type Changing Functions ● is there a problem with this code? int a=9, b=2; double c=a/b ; ● C++ provides functions for explicit conversions between types: ● function double converts to type double: int a=9, b=2; double c=double(a)/b ; ● explicit type conversion is called type casting ● warning : wrong application of casting: int a=9, b=2; double c=double(a/b) ;...
View
Full
Document
This note was uploaded on 04/22/2010 for the course CS 23021 taught by Professor Staff during the Spring '08 term at Kent State.
 Spring '08
 Staff

Click to edit the document details