#include
int saturating_add(int x,int y)
{
int sum = x + y;
int w = sizeof(int) <> (w - 1); // 取出x的符号位
int y_sign = y >> (w - 1); // 取出y的符号位
int sum_sign = sum >> (w - 1...
分类:
移动开发 时间:
2014-12-10 14:13:56
阅读次数:
250
主要针对int long char double 字节长度的识记。1 #include 2 3 int main() 4 { 5 int a[100]; 6 int (*p)[100]; 7 p=&a; 8 9 l...
分类:
其他好文 时间:
2014-12-10 12:28:46
阅读次数:
164
C代码: #include?<windows.h>
#pragma?comment(lib,?"kernel32.lib")
int?start()
{
????TCHAR?message[]?=?TEXT("Taylor?Swift\r\n泰勒·斯威夫特");
????DWORD?toWrite?=?sizeof(mess...
分类:
其他好文 时间:
2014-12-09 17:57:56
阅读次数:
209
//CycQueue.h
/*
Queue:First In First Out (FIFO)
避免假溢出:使用循环队列。
*/
#define QUEUEMAX 20
//1.定义队列结构
typedef struct
{
DATA data[QUEUEMAX]; //队列数组
int head; //队头
int tail; //队尾
}CycQueue;
/...
分类:
其他好文 时间:
2014-12-09 15:46:05
阅读次数:
270
1)修改F_mass_storage.c中fsg_common_init()的此处代码:
snprintf(common->inquiry_string, sizeof common->inquiry_string,
"%-8s%-16s%04x", cfg->vendor_name ?: "Linux",
/* Assume product name dependent on ...
分类:
移动开发 时间:
2014-12-09 10:37:29
阅读次数:
370
int Init ( ESContext *esContext )
{
esContext->userData = malloc(sizeof(UserData));
UserData *userData = esContext->userData;
GLbyte vShaderStr[] =
"uniform mat4 u_mvpMatri...
分类:
其他好文 时间:
2014-12-08 17:55:49
阅读次数:
224
0x01:简单的引用c语言中没有引用,c++有引用,简化编程引用的本质就是指针,给已经存在的变量起一个别名,sizeof求大小访问的是引用的变量引用必须一开始就初始化,一旦初始化,赋值修改将无效;int num = 10; int & rnum (num);//变量引用用括号好初始化1.cpp: 1...
分类:
编程语言 时间:
2014-12-08 00:32:09
阅读次数:
295
#include int len = sizeof(int);printf("%s\n",len);/* 编译的时候是没问题的,运行的时候就报错 */int len = sizeof(int);printf("%d\n",len); /*把%s 改为 %d就没问题了。
分类:
其他好文 时间:
2014-12-07 21:38:06
阅读次数:
187
//链表的操作
#include
#include
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
long num;
float score;
struct student *next;
};//结点
int n;//存放结点个数
struct student *creat()//创建链表
{
st...
分类:
编程语言 时间:
2014-12-07 00:10:52
阅读次数:
134
已知数组:type A[10][5]A[0][0] --A[8][4]面试常考:数组定义A[0....x][0...y]已知A[m][n] --求A[k][l]的地址: &A[m][n]+((k-m)*x +(l-n))*sizeof(type) 其中x为列数末地址 = 初始地址+( (行2-行1)...
分类:
编程语言 时间:
2014-12-06 21:27:37
阅读次数:
277