- 博客(12)
- 资源 (1)
- 收藏
- 关注
原创 C语言 goto 使用实例
#include int main(int argc,char **argv){ int i = 0; goto err2;err10: if(i%2) { err11: printf("i is single:%d \n",i); } err00: else { err01: prin
2013-12-18 15:08:09
1260
原创 ubuntu中apt-get设置网络代理
修改/etc/atp/atp.conf文件,添加Acquire::http::proxy "http://user:passwd@ip:port/";
2012-12-25 12:52:07
527
原创 struct 结构体可以这么用
#include #include #include #include typedef struct{ uint32_t msg_len; uint32_t msg_type; char msg_body[0];}MSG;#define BODY_OFFSET (unsigned long)(&(((MSG *)0)->msg_body))int main(int arg
2012-12-09 11:47:58
463
原创 linux/unix 学习
所以shell都有内置umask命令、cd命令。如果文件不可执行,而设置了保存设置 用户/组 ID,则执行位为S,否则s。例如- r x S r- - r - -,- r x s r- - r - -文件模式位设置带有 t,则表示该文件夹中,只有文件的拥有者才能删除自己的文件。
2012-11-26 21:44:22
513
转载 Linux 命令 常见特殊符号
本篇文章来源于 黑基网-中国最大的网络安全站点 原文链接:http://www.hackbase.com/tech/2011-05-26/63888.html 1,> 重定向输出符号 用法:命令 >文件名 特性:覆盖(当输入文件和输出文件是同一文件,文 件内容被清空;不适合连续重定向) 典型应用:合并文件(cat a b >c);清空文件(cat /dev/n
2012-11-02 21:50:10
816
转载 printf特效输出
转自:http://blog.chinaunix.net/space.php?uid=21222282&do=blog&id=1829073 颜色特效控制:printf("\033[1;33m Hello World. \033[0m \n");颜色如下:none = "\033[0m"black = "\033[0;30m"dark_gr
2012-09-22 09:50:14
702
原创 unlink自己的另一个硬连接 出错
#include #include #include #include #include int main(int argc,char *argv[]){ int err_bak; int fd = open(argv[1],O_RDWR); if(fd > 0) { if(0 > unlink(argv[1])) { err_bak
2012-09-18 18:29:10
437
原创 为什么这样用select,筛选式使用FD_ISSET 不行?
#include #include #include #include #include #include #include #include #define N 64typedef struct sockaddr SA;int main(int argc,char *argv[]){ int listenfd,connfd[16],i
2012-09-18 12:09:58
1140
原创 函数返回 局部指针
#include int *abc(int a);int main(){ int i=10; int *j; j = abc(i);// printf("%p\n",j); printf("%d\n",*j); printf("%p\n",j); return 0;}int *abc(int a){ int aa = a*a;
2011-12-13 11:33:12
506
原创 int fputc(int c,FILE *sream) 实例代码
#include int main(int argc,char *argv[]) { int i = 0; for(;i<400;i++) { printf("%d=",i); printf
2011-08-29 20:20:53
1142
原创 请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续
<br />#include <iostream.h>void main(){ char c,d; cout<<"please input first zimu:";wode: cin>>c; int i=c; switch(c) { case 'm': cout<<"Monday"<<endl; break; case 'w': cout<<"Wednesday"<<endl; break; case 'f': cout<<"Friday"<<endl; b
2011-03-17 19:21:00
2260
原创 复制析构函数
#include class shu{private: int x,y;public: shu(int a,int b) { x=a; y=b; cout } shu(const shu &l) { int a,b; cout } shu() { cout } ~shu() { cout } display() { cout
2010-10-20 20:49:00
537
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人