摘要: 比较重要的记着strcspn这个函数只要找到一个字节相同就会返会size了,所以"、"和"隆"第一个ASC2都是-95,strcspn认为一样,直接返回。想要查找到相同的字符串再返回必须用strstr,找到地址后去减原来的地址(小心,找不到一减就负值了)。还要,这次使用冒泡排序链表,网上说其实不好什么的,不知为毛,以下是我的code,程序有点臃肿,没功夫优化了,这事纠缠了这么多天可以结束了。void kq_order(struct kq_person* head,int kq_totall){struct kq_person *p=NULL,*q=NUL 阅读全文
posted @ 2013-02-24 13:27 yurius 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 不复习很快就忘了。注意最好要加括号啊!#include<stdlib.h>#include <stdio.h>#include<string.h>//#define x264_COPY2(x,y,a,b) if((x)<(y)) {x=y;a=b;}#define x264_COPY2(x,y,a,b) if((x)<(y)) {x=y;a=b;}//最好是#define x264_COPY2(x,y,a,b) if((x)<(y)) {(x)=(y);(a)=(b);}int main(){int a=0;int b=88;int aa= 阅读全文
posted @ 2013-02-24 13:26 yurius 阅读(224) 评论(0) 推荐(0) 编辑
摘要: char* aa=(char*)malloc(2);*aa++=33;结果是,先给*a赋33,然后再++。下面是汇编代码:56: *aa++=33;00401035 mov eax,dword ptr [ebp-4]00401038 mov byte ptr [eax],21h0040103B mov ecx,dword ptr [ebp-4]0040103E add ecx,100401041 mov dword ptr [ebp-4],ecx[ebp-4]是给局部量分配空间。21h无疑是33啦。另有坑爹问题一个:函数声明是void (*intra_satd_x3_8x8c) ( uint8 阅读全文
posted @ 2013-02-24 13:25 yurius 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 直接看代码,仿计算satd的函数typedef int (*x264_pixel_cmp_t) ( uint8_t *, int, uint8_t *, int );typedef int (*x264_test)(int,int);int addab(int a,int b);int c=0;x264_test x_t[20];x_t[10]=addab;c=x_t[10](1000,200);//注意这里的x_t[10]已经是相当于*(x_t+10),故不用再加*printf("%d",c);return 0;}int addab(int a,int b){return 阅读全文
posted @ 2013-02-24 13:22 yurius 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 一、int aa[2][3][2]={{{1,2},{3,4},{5,6}},{{7,8},{9,10},{1,2}}};__int64 b=*(__int64*)aa[1][2];__int64 a;a=b>>32;//高位printf("%d\n",a);int c;c=(int)b;//低位printf("%d\n",c);输出:21二、int a=0x0101;short b;b=a;这样赋值连个warning都没有,是无一点问题的。同样地:int a=0x41;unsigned char b;b=a;这样也是OK的。三、设dst是一 阅读全文
posted @ 2013-02-24 13:18 yurius 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 1VC的>>按位右移反汇编是sar算术右移,即保持最高位不变往右移。2 这个:static inline uint8_t x264_clip_uint8( int x ){return x&(~255) ? (-x)>>31 : x;}x&(~255)即x与FFFFFF00按位与,这样如果x只有低8位(一个字节),就保持不变(合函数名)如果x高于8位,且是正数则(-x)>>31是将其符号取反后取出。注意,用最高位表示符号则正负各能占一半。 阅读全文
posted @ 2013-02-24 13:17 yurius 阅读(917) 评论(0) 推荐(0) 编辑
摘要: 1.cpp#include <stdio.h>#include<stdlib.h>#define one123 123extern bb;void main(){int aa;aa=1;aa=one123;printf("%d\n",aa);printf("%d",bb);}2.cpp#define one123 233int bb=one123;总结:两个文件的宏定义只在本文件中有效,不干涉其它文件,而若要用到另一文件的变量必须extern 阅读全文
posted @ 2013-02-24 13:15 yurius 阅读(967) 评论(0) 推荐(0) 编辑
摘要: 1 我一直以为运行后才会生成.exe,才知道编译成功就生成了,坑爹啊。。。。2把文件拖拽到cmd里,cmd会自动把文件的完整路径写在命令行上3 头文件和源文件不必一一对应,如函数在1.h里声明,在2.c里实现,在3里包含1.h仍可以通过4程序如下:char aa=0;int bb=1;int cc=0x0f0f0f0f;int dd=0x01040508;则他们的地址如下:+ &aa 0x0012ff7c ""+ &bb 0x0012ff78+ &cc 0x0012ff74+ &dd 0x0012ff70正好相反。5void* 也可以代替FI 阅读全文
posted @ 2013-02-24 13:14 yurius 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 1 先做好一个lib,编译后会在debug中生成一个lib2 将lib拷贝到要使用该lib的工程文件夹里3 在工程设置的object/lib modules 里添加些lib4 在要调用此lib的工程声明定义在lib的函数,即可直接使用 阅读全文
posted @ 2013-02-24 13:13 yurius 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 直接看代码1.cppint add(int a);void myini();int abcaaa();extern int abc;//int abc;int main(){myini();int a=1;int z=add(a);printf("the z is %d\n",z);printf("the abc is %d",abc);int zz=abcaaa();printf("z is %d\n",zz);return 0;}2.cppint abc=212;int aaa=0;int add(int a){return (a 阅读全文
posted @ 2013-02-24 13:12 yurius 阅读(260) 评论(0) 推荐(0) 编辑