#include "OJ.h"
#include
#include
using namespace std;
/*
Description
取给定正整数的指定bit位开始的指定长度的数据。bit位从右向左从0开始计算。
Prototype
unsigned int GetBitsValue(unsigned int input, unsigned in...
分类:
其他好文 时间:
2014-12-13 21:53:22
阅读次数:
320
一 自动类型转换1. 非赋值运算的类型转换 水平方向的转换:所有的 char, short 型自动转换成 int 型,左右的 unsigned short 型自动转换成 unsigned 型,所有的 long 型自动转换成 unsigned long 型,所有的 float 型自动转换成 doubl...
分类:
其他好文 时间:
2014-12-13 12:08:45
阅读次数:
212
void HexStrToByte(const char *src, unsigned char *dest, int srcLen) { short i; unsigned char highByte, lowByte; for (i = 0; i < srcLen; i += 2) { highByte = toupper(src[i]); lowByte ?= toupper(src...
分类:
系统相关 时间:
2014-12-12 17:13:29
阅读次数:
272
C++的64位整数[原]by 赤兔 在做ACM题时,经常都会遇到一些比较大的整数。而常用的内置整数类型常常显得太小了:其中long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647。而unsigned范围是[0,2^32),即0~4294967295。也就....
分类:
编程语言 时间:
2014-12-12 11:28:13
阅读次数:
233
UDP数据报UDP首部代码:struct udp_hdr
{
unsigned short src_port;
unsigned short dest_port;
unsigned short len;
unsigned short chksum;
}; TCP报文段 协议描述源端口号和目的端口号:源和目的主机的IP地址加上端口号构成一个TCP连接序号和确认号:序号...
分类:
其他好文 时间:
2014-12-11 14:07:14
阅读次数:
217
原文:初始化一个多维数组《C和指针》第8章编程练习第1题: 1 /* 2 ** 初始化一个数组,其特定位置初始化为特定的值 3 */ 4 5 static unsigned char char_value[3][6][4][5] = { 6 { // 0 7 { // 0,0 8 { 0 } // ...
分类:
编程语言 时间:
2014-12-11 10:09:17
阅读次数:
155
原文:把数字数值转换成单词形式《C和指针》第7章第6道编程题:
编写函数
void written_amount( unsigned int amount, char *buffer );
它把 amount 表示的值转换为单词形式,并存储于 buffer 中。这个函数可以在一个打印支票的程序中使用...
分类:
其他好文 时间:
2014-12-11 10:07:52
阅读次数:
183
原文:【 c语言中无符号和有符号的加法运算】【深入理解】--【sky原创】
第一题
#includeint main(){unsigned int a=6;int b=-20;printf("%d\n",a+b);(a+b)>6? puts(">6"):puts("6 第二题
#includeint...
分类:
编程语言 时间:
2014-12-11 10:03:37
阅读次数:
203
以下是经过DEV-C++调试过的代码 还有框图:
头文件hashlist.h
#ifndef _H_HASHLIST_
#define _H_HASHLIST_
#define HASH_NUM_MAX 100
#define u32 unsigned int
//typedef struct _Node * pNode;
//typedef struct _Hash...
分类:
其他好文 时间:
2014-12-10 22:51:52
阅读次数:
295
两个链表的第一个公共结点
两个链表相交成Y型。
#include
#include
using namespace std;
struct ListNode{
int value;
ListNode* next;
};
unsigned int getListLength(ListNode* pHead){
unsigned int length = 0;
...
分类:
其他好文 时间:
2014-12-10 18:03:58
阅读次数:
157