Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
November 24, 2017, 10:23:41 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Local Variables  (Read 1322 times)
MCaEd
Newbie
*
Posts: 49


« on: February 20, 2012, 11:34:40 AM »

When talking about the loval variables in the book, there is an example of reduce method.
The book says:
Quote
The three local variables in the reduce method are set to values before they are used...
- p.140
But if you look at the code, one of these variables temp is not set to any values:
Quote
int temp;
Why?
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #1 on: February 20, 2012, 12:58:57 PM »

It's not well-worded.  All three variables are set before they're used; temp gets set a little later (inside the loop), but again, it gets set first before its value is used.   

Thanks,

Steve
Logged
MCaEd
Newbie
*
Posts: 49


« Reply #2 on: February 21, 2012, 04:58:06 PM »

Thank you, Steve.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.