Cpp_notes_summary_3

Cpp_notes_summary_3 - Chapter 3 Organization 3.1 Functions...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 3 Organization 3.1 Functions 3.1.1 Functions included in standard library #include < iostream > #include < cmath > using namespace std ; int main () { const double PI=acos ( 1.0); double x , y ; x=2.0; y=exp (x PI ) ; cout << y << endl ; return 0; } 3.1.2 User defned ±unctions In general this is Functions data type function name ( data type variable1 , data type variable 2 . . . ) { code return ( constant or variable with the same data type as function ) } How to Compile Multiple Files g++ FUNCTION EXAMPLE. cpp FUNCTIONS. cpp o FUNCTION EXAMPLE OR g++ c FUNCTION EXAMPLE. cpp g++ c FUNCTIONS. cpp g++ FUNCTIONS. o FUNCTION EXAMPLE. o o FUNCTION EXAMPLE PARAMETERPASSING EXAMPLE.cpp #include < iostream > 10
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MAT 5939-04 Pierre Garreau #include < cmath > using namespace std ; double square1 ( double a) { a=pow(a , 2 . 0 ) ; return (a ) ; } double square2 ( double { a=pow(a , 2 . 0 ) ; return (a ) ; } int main () { double x , y ; x=2.0; y=square1 (x ) ; cout
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2012 for the course MAT 5939 taught by Professor Garreau during the Fall '11 term at FSU.

Page1 / 3

Cpp_notes_summary_3 - Chapter 3 Organization 3.1 Functions...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online