I\'m new to programming and I started to make my own Fire Emblem level up calculator, but for some reason it loops infinitely. I can\'t find an answer. Could you look for an
You have two major problems which may cause compilation error.
nr+1;
level-1;
You have to assign them into some variable. Try this:
nr = nr+1;
or
nr++;
and
level = level -1;
or
level--;
now the while loop is not going to loop infinite.
Second problem is
if (cha[6] = 'Dieck' )
Note that, = is an assignment operator, not an equal operator. Equal operator looks like double equal ==. As you want to compare whether cha is equal to Dieck or not, try this:
if (strcmp (cha, "Dieck") == 0)
But you need to include #include for that.
Reference here.