I haven’t analyzed what your code is doing but I can tell you the difference between ==
and =
.
==
is an equality comparison operator. It allows to check if the left hand side and the right hand side are equal, in which case it returns the bool
ean value true
otherwise false
.
=
, on the other hand, is an assignment operator. It allows you to give the value on the right-hand side to a variable on the left-hand side. So the compiler is right here in warning you that '==': operator has no effect; did you intend '='?
Therefore, inside your do {...} while
loop you should be using =
statements instead of ==
.
solved Is it possble to convert a number to decimal base ten using do while? [closed]