标题:位移问题,有一段不明白!
取消只看楼主
古丁高手
Rank: 1
来 自:地狱
等 级:新手上路
帖 子:56
专家分:8
注 册:2012-8-8
结帖率:57.14%
 问题点数:0 回复次数:0 
位移问题,有一段不明白!
#include <stdio.h>
#include <stdlib.h>


void main()
{
    unsigned long input_IP;
    unsigned int BeginByte,MidByte,ThirdByte,EndByte;
    unsigned int_rotate=0x07;
                                             
    printf("******************************************************\n");
    printf("** This program is to show how to parse a IP address**\n");
    printf("******************************************************\n");                                             
    printf("Please enter the IP address(hex) you want parse:");
    scanf("%lx",&input_IP);
    BeginByte   = (input_IP >> 24) & ~(~0 << 8);
    MidByte = (input_IP >> 16) & ~(~0 << 8);
    ThirdByte  = (input_IP >> 8 ) & ~(~0 << 8);
    EndByte   = input_IP         & ~(~0 << 8);
    printf("******************************************************\n");
    printf("The IP address after parsed is: %d.%d.%d.%d\n",BeginByte,MidByte,ThirdByte,EndByte);
    /*介绍两个循环移位函数*/     
    printf("******************************************************\n");
    printf("%u after rotated twice is =%u\n",int_rotate,_rotl(int_rotate,2));
    printf("%u after rotated once is =%u\n",int_rotate,_rotr(int_rotate,1));
    scanf("%d",int_rotate);

}
  

    BeginByte   = (input_IP >> 24) & ~(~0 << 8);
    MidByte = (input_IP >> 16) & ~(~0 << 8);
    ThirdByte  = (input_IP >> 8 ) & ~(~0 << 8);
    EndByte   = input_IP         & ~(~0 << 8);
这一段不明白
搜索更多相关主题的帖子: long void address include 
2013-03-17 00:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-401053-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.352809 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved