How can I remove a flag in C?

前端 未结 3 1154
感动是毒
感动是毒 2020-12-12 10:23

There is a variable that holds some flags and I want to remove one of them. But I don\'t know how to remove it.

Here is how I set the flag.

my.emask          


        
3条回答
  •  遥遥无期
    2020-12-12 10:33

    It's important to note that if the variable being manipulated is larger than an int, the value used in the 'and not' expression must be as well. Actually, one can sometimes get away with using smaller types, but there are enough odd cases that it's probably best to use type suffixes to make sure the constants are large enough.

提交回复
热议问题