View Single Post
  #7   Spotlight this post!  
Unread Today, 00:09
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 162
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Trouble With Variables

Great advice on the 'double' and the '&&' ... one more note on the 'and' verus '&&'... in C/C++, be sure to use TWO '&&' and not ONE. The language is happy to allow you to use a single '&' but it will not evaluate the logical expression as you desire. It's for a different purpose. Similarly, C can be confusing with the use of TWO '==' versus ONE '='. ONE is for assignment and the other for comparison. It was a major mistake in the language (IMHO) as beginners often accidentally write an if/then expression and use a single '=' which ultimately creates a bug that's hard to find. Sigh.

Be careful - it looks like you're off to a good start, frankly.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote