View Single Post
  #6   Spotlight this post!  
Unread Yesterday, 17:58
Pay Me $2's Avatar
Pay Me $2 Pay Me $2 is offline
Registered User
AKA: La-Ya
FRC #4159 (CardinalBotics)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2017
Location: San Francisco, CA
Posts: 4
Pay Me $2 is an unknown quantity at this point
Re: Trouble With Variables

I wouldn't be discouraged if I were you. As BrianK said, you are assigning floating-point values to an integer variable. Since you're new to programming, I'll explain that in more basic terms. A variable that is of type int must be assigned a whole-number value. Therefore, I would suggest changing "int x = 0.5" to "double x = 0.5". Also, "and" doesn't work in C++. Instead of "and", use "&&".

Hope this helps!
Reply With Quote