上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 74 下一页
摘要: #include <iostream>using namespace std;class test{public: test(int a,...); ~test(); void setdata(); void showdata(); int **data; int *N; //存储每个参量的值 int n; //统计参量的个数};test::test(int a,...){ int *p=&a; n=0; while (*p!=0) { n++; p++; } data=new int... 阅读全文
posted @ 2012-09-11 14:35 Dsp Tian 阅读(416) 评论(0) 推荐(0) 编辑
摘要: /*va_list vl; //定义一个指向参数列表的变量(一个...指针)va_start(vl,first_param); //把指向参数列表的变量初始化va_arg(vl,mode); //获取下一个参数,参数类型由第二个参数指定,第二个参数用于在va_arg内部进行尺寸计算,以便找到下一个参数va_end(vl); //结束*/#include <iostream>#include <cstdarg> //头文件包含:C++ <cstdarg>; C <stdarg.h>using namespace std;void variable( 阅读全文
posted @ 2012-09-11 09:49 Dsp Tian 阅读(482) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;int main(){ double **a; a=new double *[3]; //初始一个三行二列的矩阵 for (int i=0;i<3;i++) { a[i]=new double[2]; } a[0][0]=1; a[0][1]=2; a[1][0]=4; a[1][1]=5; a[2][0]=7; a[2][1]=8; for (int i=0;i<3;i++) { ... 阅读全文
posted @ 2012-09-10 20:26 Dsp Tian 阅读(9081) 评论(0) 推荐(0) 编辑
摘要: 新用这个,不太熟悉,最后那几步老忘,先把自己用的记在这里。 首先在github上注册一个账号。 下载git客户端,我windows下的是git-1.7.11-preview,搜一下网上很多。ubuntu内置了有git。 打开git bash。 输入 git config –global user.n 阅读全文
posted @ 2012-09-10 15:50 Dsp Tian 阅读(504) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <termios.h>int main(){ char s;// FILE *in;// FILE *out; struct termios initial_settings,new_settings;// in=fopen("/dev/tty","r");// out=fopen("/dev/tty","w"); tcgetattr(fileno(stdin),&initial_settings);//保存原来的设置 new_s 阅读全文
posted @ 2012-09-09 21:20 Dsp Tian 阅读(796) 评论(0) 推荐(0) 编辑
摘要: #include <sys/utsname.h>#include <unistd.h>#include <stdio.h>int main(){ char computer[256]; struct utsname uts; if(gethostname(computer,256)!=0 || uname(&uts)<0) { exit(1); } printf("Computer host name is %s\n",computer); printf("Syste... 阅读全文
posted @ 2012-09-09 16:42 Dsp Tian 阅读(673) 评论(0) 推荐(0) 编辑
摘要: #include <sys/types.h>#include <stdio.h>#include <pwd.h>#include <unistd.h>int main(){ uid_t uid; gid_t gid; struct passwd *pw; uid =getuid(); gid=getgid(); printf("User is %s\n",getlogin()); printf("User IDs:uid=%d,gid=%d\n",uid,gid); pw=getpw... 阅读全文
posted @ 2012-09-09 16:26 Dsp Tian 阅读(477) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ char tmpname[L_tmpnam]; char *filename; FILE *tmpfp; filename=tmpnam(tmpname); printf("tmp file is : %s\n",filename); tmpfp=tmpfile(); if(tmpfp) printf("open a tmp file ok\n"); else ... 阅读全文
posted @ 2012-09-09 14:41 Dsp Tian 阅读(558) 评论(0) 推荐(0) 编辑
摘要: #include <time.h>#include <stdio.h>int main(){ time_t the_time; (void)time(&the_time); printf("The date is: %s",ctime(&the_time)); return 0;}函数原型:#include <time.h>char *ctime(const time_t *timeval);注:上一篇获得的时间是标准格林威治时间。 阅读全文
posted @ 2012-09-09 14:21 Dsp Tian 阅读(473) 评论(0) 推荐(0) 编辑
摘要: #include <time.h>#include <stdio.h>int main(){ struct tm *tm_ptr; time_t the_time; (void) time(&the_time); tm_ptr=gmtime(&the_time); printf("Raw time is %ld\n",the_time); printf("gmtime gives:\n"); printf("date: %02d/%02d/%02d\n", tm_ptr->tm_year, 阅读全文
posted @ 2012-09-09 14:09 Dsp Tian 阅读(459) 评论(0) 推荐(0) 编辑
上一页 1 ··· 53 54 55 56 57 58 59 60 61 ··· 74 下一页