会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
-.-. -..- ....
长歌怀采薇
博客园
首页
新随笔
联系
管理
上一页
1
2
3
4
5
6
7
下一页
2015年2月27日
C输出帕斯卡三角(杨辉三角)递归实现
摘要: 1 /*帕斯卡三角形(杨辉三角)*/ 2 int Recursive_Pascal_Triangle( int i, int j ) 3 { 4 if( (j == 0) || (i == j) ) 5 return 1; 6 else{ 7 ret...
阅读全文
posted @ 2015-02-27 22:18 永久指针
阅读(669)
评论(0)
推荐(0)
2015年2月26日
C十进制和二进制转化
摘要: 1 /*递归形式的十进制数转化为二进制数*/ 2 void D2B( int n ) 3 { 4 if( n == 0 ) 5 return ; 6 else{ 7 D2B( n/2 ); 8 printf("%d",n%2); 9 ...
阅读全文
posted @ 2015-02-26 22:06 永久指针
阅读(456)
评论(0)
推荐(0)
C递归实现字符串循环右移
摘要: 设计一个函数轮转字符串。例如将“abcd”转为"dabc"递归实现方式: 1 /*将字符串循环右移n个单位*/ 2 void move(char s[], int n) 3 { 4 if( n == 0) 5 return ; 6 else{ 7 in...
阅读全文
posted @ 2015-02-26 11:25 永久指针
阅读(631)
评论(0)
推荐(0)
2015年2月24日
difference between char *s and char s[ ]
摘要: The difference here is that : char *s = "hello,world!";will place hello,world in read-only part of the memmory and makes s a pointer to that. makin...
阅读全文
posted @ 2015-02-24 21:28 永久指针
阅读(125)
评论(0)
推荐(0)
define vs const vs enum
摘要: 以前用C,习惯了define;const,enum 什么的基本不太会用,现在有时间整理一下。/*******************************************************************************************************...
阅读全文
posted @ 2015-02-24 20:37 永久指针
阅读(361)
评论(0)
推荐(0)
2015年1月16日
解决Ubuntu 14.04 LTS 浏览网页速度慢的问题
摘要: Ubuntu 14.04 (其他版本可能适用)浏览网页慢的一个重要原因是DNS默认为:172.0.0.1 查看/etc/resolv.conf 会看到他使用的dns是 nameserver 127.0.1.1 操作过程:修改/etc/resolv.conf, 将nameserver 改为你...
阅读全文
posted @ 2015-01-16 18:42 永久指针
阅读(656)
评论(0)
推荐(0)
2014年6月2日
C语言两种产生矩阵的方法
摘要: 用malloc生成m*n的矩阵的两种方法: 1:使用指针数组 1 int** create_matrix(int m, int n) 2 { 3 int **mat = (int**) malloc (sizeof(int*) * m); 4 int i; 5 for(i=0...
阅读全文
posted @ 2014-06-02 18:10 永久指针
阅读(1927)
评论(0)
推荐(0)
2014年5月27日
GTK 添加图标
摘要: 1 #include 2 3 /*从一个图象文件中生成 GdkPixbuf 类型数据*/ 4 GdkPixbuf * create_pixbuf(const gchar *filename) 5 { 6 GdkPixbuf *pixbuf; 7 GError *error = ...
阅读全文
posted @ 2014-05-27 10:17 永久指针
阅读(1797)
评论(0)
推荐(0)
2014年5月26日
Unix Socket 端口 reuse
摘要: 如果服务端的程序关闭后,端口不能马上释放掉,需要等一会才能小时,在这之间再启动服务程序是起不来的,但是可以用这个函数,边面这种情况,服务程序关闭后,可以马上再起一次,不会冲突了。listenfd = socket(AF_INET, SOCK_STREAM, 0);/* Enable addres...
阅读全文
posted @ 2014-05-26 21:03 永久指针
阅读(687)
评论(0)
推荐(0)
2014年5月25日
Linux GTK Hello,World
摘要: 1 #include 2 3 int main(int argc, char **argv) 4 { 5 GtkWidget *window; 6 gtk_init(&argc, &argv); 7 window = gtk_window_new(GTK_WINDOW_...
阅读全文
posted @ 2014-05-25 17:32 永久指针
阅读(274)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
下一页
公告