123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|472|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> C/C++/C#/Other -> C++ class, Week 4

Sat, 17 Oct 2009, 07:51
Afr0
In this week's official class we've reached Chapter 4, which is about structuring your code with functions.

Challenges

1. Write a function that multiplies two numbers and returns the result.
2. Change the function you wrote in Challenge 1 so that it remembers how many times you called it.
3. What's the difference between a global variable and a static variable? Which is better in which situation and why?
4. Try rewriting the 'The Cave Adventure Game' so that it does not use functions (an excersize to convince you how useful functions are).
5. Buy a Slurpee.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Sat, 17 Oct 2009, 08:50
Afr0


-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Sun, 18 Oct 2009, 12:56
Afr0
1.


2.


3. Global variables have file scope, static variables have/can have code block scope. Both kinds persists throughout the entire execution of the program.

4. To Be Continiued

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!