上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 73 下一页
摘要: #include <sys/types.h>#include <sys/wait.h>#include <unistd.h>#include <stdio.h>int main(){ pid_t pid; char *m; int n; pid=fork(); if(pid==0) { m="this is child"; n=5; } else { m="this is fath... 阅读全文
posted @ 2012-09-28 16:23 Dsp Tian 阅读(2115) 评论(0) 推荐(0) 编辑
摘要: #在宏中表示把参数变为字符串##在宏中表示连接两个参数#include <iostream>using namespace std;#define str(s) #s#define cons(a,b) a##bint main() { cout<<str(asfsd)<<endl; cout<<cons(1,2)<<endl; system("pause"); return 0; } 阅读全文
posted @ 2012-09-21 10:54 Dsp Tian 阅读(632) 评论(0) 推荐(0) 编辑
摘要: // overload_date.cpp// compile with: /EHsc#include <iostream>using namespace std;class Date{ int mo, da, yr;public: Date(int m, int d, int y) { mo = m; da = d; yr = y; } friend ostream& operator<<(ostream& os, const Date& dt);};ostream& operator<<(ostream& os, c 阅读全文
posted @ 2012-09-19 16:24 Dsp Tian 阅读(469) 评论(0) 推荐(0) 编辑
摘要: extern "C" {#include "lua.h" #include "lualib.h" #include "lauxlib.h"}; /* Lua解释器指针 */lua_State* L;int main ( int argc, char *argv[] ){ /* 初始化Lua */ L = lua_open(); /* 载入Lua基本库 */ luaL_openlibs(L); /* 运行脚本 */ luaL_dofile(L, "test.lua"); /* 清除Lu... 阅读全文
posted @ 2012-09-18 20:13 Dsp Tian 阅读(612) 评论(0) 推荐(0) 编辑
摘要: 解决方案:sudo rm /var/lib/apt/lists/* -vfsudo apt-get update 阅读全文
posted @ 2012-09-15 09:20 Dsp Tian 阅读(392) 评论(0) 推荐(0) 编辑
摘要: #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 阅读(481) 评论(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 阅读(9080) 评论(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) 编辑
上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 73 下一页