View Single Post
  #9   Spotlight this post!  
Unread 05-11-2004, 15:44
Steve Shade Steve Shade is offline
Registered User
no team
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1999
Location: Pasadena, MD
Posts: 78
Steve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud ofSteve Shade has much to be proud of
Re: Can't use pointers nor refrences.

Quote:
Originally Posted by Max Lobovsky
..., but I would have thought it better practice to return the value than output from inside the function. Isn't it good practice, in general, to have functions be as close to real mathematical functions as possible (one set of inputs always maps to the same outputs and the only outputs are what the function returns)
Generally speaking, you are correct. If I or one of my team members were to write a function similar to the one Greg pointed out, we would have used a return statement and made the function of type unsigned char. However, Innovation FIRST tries to give a wide variety of examples in the default code to facilitate teams in developing their own code. This example will help some people see the syntax of a pointer in code, or help them understand one of the trickier programming topics. In most cases, you want to avoid pointers when possible.

Steve

Last edited by Steve Shade : 05-11-2004 at 15:45. Reason: spelling