• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cannot convert from long to byte

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for some reason I get this error in this code, how can I fix it?

 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you familiar with casting?
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I tried this and it worked, thanks
 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
however I get strange results


It prints out "-77 -77 -77 -77" I can figure out why I get the same numbers
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: The >> operator has preference above the & operator.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic