随笔分类 -  其他

摘要:g++ filename.c -o output -lmingw32 -lSDL2main -lSDL2_test -lSDL2关键是后面4 个选项顺序不能乱 阅读全文
posted @ 2015-06-03 15:35 Netop 阅读(732) 评论(2) 推荐(0)
摘要:使用 __attribute__((packed))例如struct TEST { short x; int y;}__attribute__((packed));此时sizeof(TEST)等于6,可见此时不是自动对齐或者使用#pragma pack,详见百度百科 阅读全文
posted @ 2015-04-11 19:20 Netop 阅读(1384) 评论(0) 推荐(0)
摘要:可以直接使用一维数组来模拟二维数组,下面的代码就是在此基础上,用一个二级指针指向一维数组的相应地方,详见代码#include #include int main(){ int row,col,i,j,n=0; row=col=3;//malloc连续内存的二维数组 int **ar... 阅读全文
posted @ 2015-03-21 09:26 Netop 阅读(1352) 评论(0) 推荐(0)
摘要:C语言中默认是以结构体中最长的数据类型为对齐标准如typedef struct _NODE{ short a; int b; char c;}NODE;会以int,即4字节为对齐标准,此时sizeof(NODE)=12可以使用#pragma pack(n)改变对齐方式。编译器会从“n”和”结构... 阅读全文
posted @ 2015-03-20 10:35 Netop 阅读(667) 评论(0) 推荐(0)
摘要:转自:http://blog.chinaunix.net/uid-23592843-id-150648.html先区分几个概念:16色和16位色一样吗?不一样!颜色位数,即是用多少位字节表示的值,每一位可以表示0和1两值。通常图片的颜色深度,简称色深,就是用位数来表示的,所以,我通常会看到8位色,1... 阅读全文
posted @ 2015-03-19 14:51 Netop 阅读(607) 评论(0) 推荐(0)
摘要:#include #include int main(){ time_t raw; struct tm* ti; time(&raw); ti=localtime(&raw); printf("%d-%d-%d %d:%d:%d\n",ti->tm_year+1900,ti->tm_mon+1,... 阅读全文
posted @ 2014-10-20 09:14 Netop 阅读(162) 评论(0) 推荐(0)
摘要:import http.client,urllib.parsehost = 'iflying.sinaapp.com' #主机域名path = '/test.php' #资源名params = urllib.parse.urlencode({ #要传送的数据 'username':'Tom'... 阅读全文
posted @ 2014-09-11 23:20 Netop 阅读(145) 评论(0) 推荐(0)
摘要:原帖地址:http://blog.csdn.net/windone0109/article/details/4030274TortoiseSVN是windows下其中一个非常优秀的SVN客户端工具。通过使用它,我们可以可视化的管理我们的版本库。不过由于它只是一个客户端,所以它不能对版本库进行权限管理... 阅读全文
posted @ 2014-09-05 08:33 Netop 阅读(95) 评论(0) 推荐(0)
摘要:#include #include int main(){ printf("sleeping\n"); Sleep(3*1000); printf("sleep end\n"); return 0;}#include #include inline void delay(float);int mai... 阅读全文
posted @ 2014-08-19 09:52 Netop 阅读(509) 评论(0) 推荐(0)