| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 581 人关注过本帖
标题:位移问题,有一段不明白!
取消只看楼主 加入收藏
古丁高手
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
快速回复:位移问题,有一段不明白!
数据加载中...
 
   



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

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