#include #include #define U8 unsigned char#define U16 unsigned int/******************************************************************** ...
分类:
其他好文 时间:
2015-07-28 12:57:59
阅读次数:
113
如果在编译MFC程序的时候出现下列及类似的错误:1>uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMTD.lib(new.obj)...
分类:
其他好文 时间:
2015-07-28 10:35:24
阅读次数:
155
在10*9的中国象棋的棋盘中,马只能走“日”字,不考虑蹩脚。马从任意位置处出发,把棋盘的每一格都走一次,且只走一次,设计程序求解。
#include
#include
using namespace std;
typedef unsigned char BYTE;
//#define Width 9
//#define Height 10
#define Width 6
#define...
分类:
其他好文 时间:
2015-07-28 06:46:00
阅读次数:
118
1 //假设硬件平台是intel x86(little endian) 2 3 typedef unsigned int uint32_t; 4 void inet_ntoa(uint32_t in) 5 { 6 char b[18]; 7 ...
分类:
编程语言 时间:
2015-07-28 00:28:59
阅读次数:
209
为了加深对I2C总线的理解,用C语言模拟IIC总线,边看源代码边读波形:如下图所示的写操作的时序图:读时序的理解同理。对于时序不理解的朋友请参考“I2C总线之(二)---时序”完整的程序如下:#include#define uchar unsigned char#define uint unsign...
分类:
其他好文 时间:
2015-07-27 18:44:51
阅读次数:
118
对于char型数据,一般会分为无符号和有符号两种类型,这里说明一下这两者的范围问题
首先是无符号char,这个简单,
0000 0000 ~ 1111 1111 范围也就是0 ~ 255
那么对有符号char呢??
首先清楚一个东西,对于有符号数,最高位为符号位,0为正,1为负
那么按照跟上面一样的思路,范围为:
1111 1111 ~ 0111 1111 也就是-127 ~ ...
分类:
其他好文 时间:
2015-07-27 15:05:21
阅读次数:
144
Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl...
分类:
其他好文 时间:
2015-07-27 14:47:21
阅读次数:
98
一、 表设计库名、表名、字段名必须使用小写字母,“_”分割。库名、表名、字段名必须不超过12个字符。库名、表名、字段名见名知意,建议使用名词而不是动词。建议使用InnoDB存储引擎。存储精确浮点数必须使用DECIMAL替代FLOAT和DOUBLE。建议使用UNSIGNED存储非负数值。建议使用INT...
分类:
其他好文 时间:
2015-07-27 14:43:13
阅读次数:
84
先根据以下代码来创建表MonthlyOrders并导入一定的数据CREATE TABLE MonthlyOrders(ordermonth DATE,ordernum INT UNSIGNED,PRIMARY KEY (ordermonth));INSERT INTO MonthlyOrders S...
分类:
数据库 时间:
2015-07-27 13:07:29
阅读次数:
158
斐波那契数列递归实现/**
* @author 韦轩
* @time 2015/07/26
* @brief 递归求菲波那切数列的第N项
* @param n,无符号的整数,要求的第N项
* @return 返回第N项
*
*/
long long getNthNumberWithRecursion(unsigned int n)
{
int result[2] = { 0...
分类:
其他好文 时间:
2015-07-27 00:23:13
阅读次数:
240