What type of variable is total, how was it defined?
Remember a char can only hold values between -128 to +127 anything else is out of range. Those "special" characters are probably out of the range of the char type.
Also don't forget only char values with values of zero to 127 are valid ASCII characters.