If you did not do assignment 1, you are likely to be instructor dropped from the class...
If you haven't already, sign up for the class mailing list. I have already given instructions for account setup and information about project 1, in addition to having answered questions. And only list members can view the archives.
CS151 -- Administration Notice
You should have read Chapter 1, chapter 2 and be moving into Chapter 3 today!We are doing more of Chapters 2 and 3 today...
Quiz #1 is Thursday....
Project 1 is posted, and due next Friday, by midnight:
http://www.cs.unm.edu/~storm/C++/cs151_summer2001/Assignment1.html
Functions
int main()
CS151 -- Shawn Stoffer
Functions
int main()prototype (declaration) vs definition
CS151 -- Shawn Stoffer
Functions
int main()Parts of the Declaration:
- return type
- function name
- arguments
CS151 -- Shawn Stoffer
Functions
int someFunc(int value)Function parts:
- return type: int
- function name: someFunc
- parameters: (1) named value, of type int.
CS151 -- Shawn Stoffer
Functions
int someFunc(int value)Function parts:
- return type: int
- what the return statement really means
CS151 -- Shawn Stoffer
Functions
int someFunc(int value)Function parts:
- Function name
- How a function is called
CS151 -- Shawn Stoffer
Functions
int someFunc(int value)Function parts:
- Parameters
- list of things that the function needs to know about
- Calling: if (someFunc(5) > 3)
CS151 -- Shawn Stoffer
Functions
int someFunc(int value, string anotherValue)Function parts:
- more than one parameter
- calling: if (someFunc(5, "Hello") > 3)
CS151 -- Shawn Stoffer
Functions
Parameters
- call by value: copying
- original variable is not changed
CS151 -- Shawn Stoffer