涛's profile秋叶无痕PhotosBlogLists Tools Help

Blog


    April 02

    & 和 | 的用法

           很丢人,居然连这个都忘记了,还是写下吧,不要以后又忘记了!是关于 & 位于 和 | 或者 的 用法。
           比如: 10 & 1  , 10的机器码是1010 , 1的机器码是0001,
            1010
          &0001   因为&是上下找相同的数字且为都为‘1’  然后再计算
       得出0000  所以结果为 0
    同样1010
        &0010  结果就为2   ;因为在第二位都为1。而且有用法是判断 if(N&1) 的情况。
     
    而 | 正好相反  是相加。DSC03736

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://runningwater0.spaces.live.com/blog/cns!A537D9A77A6D9171!208.trak
    Weblogs that reference this entry
    • None