|
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
|