I'm working on an assignment that requires me to use "const unsigned char &fret" as input for a method. I have
void fretThing(const unsigned char &fret)
{
char div = fret / 12;
printf("%d\n", div);
}
but when I run the program, div = 0. I believe this is because char converts the number into an int, but when i try to cast to a double, it still does not work.
Is there any way to convert char to double?
when fret = 12, div =1. but when fret is not a multiple of 12, it returns 0.