It appears that you're trying to assign a tilde to a character, based upon the value of
flag. Why are you going to the trouble of converting to a long? Just test the value of
flag in an
if statement, and act accordingly. If you must,
long lflag = 0;
if (flag) lflag=1;
long iApplyTilde = lflag;
but I see no reason for all that extra work.