ChinaUnix.net
相关文章推荐:

lua 调用c

有这样三个函数 int test(color="red">lua_state* L) { } int test1(color="red">lua_state* L) { } int test2(color="red">lua_state* L) { } 我将同一个c函数注册为不同的名称 register("test1", test) register("test2", test) 就是想让所有的这些引用名称都指向同一个函数,然后不管color="red">调用什么函数都会通过这个test函数,在这个函数中做一些操作再回调到他们自己的函数中,比如"test1"转到test1所对应的函数中。 int test(color="red">lua_state* L) { //一些...

by mysll - C/C++ - 2008-10-04 15:07:06 阅读(1765) 回复(2)

相关讨论

http://www.cppblog.com/lxyfirst/archive/2008/10/29/65447.html

by lxyfirst - C/C++ - 2008-10-29 14:39:14 阅读(1096) 回复(0)

例e10.c [code]/* A simple color="red">lua interpreter. */ #include #include int main(int argc, char *argv[]) { char line[BUFSIZ]; color="red">lua_State *L = color="red">lua_open(0); while (fgets(line, sizeof(line), stdin) != 0) color="red">lua_dostring(L, line); color="red">lua_close(L); return 0; }[/code] 編譯 gcc e10.c -lcolor="red">lua -lcolor="red">lualib -o e10 出現下面錯誤訊息 e10.c:7:27: error: macro "color="red">lua_open" passed 1 arguments, but takes just 0 e10.c: In function ...

by shihyu - C/C++ - 2009-11-01 18:42:05 阅读(1249) 回复(1)

去年琢磨很长时间,贴出来共享。 依次执行: make make test test [ 本帖最后由 yuanchengjun 于 2007-4-29 13:15 编辑 ]

by yuanchengjun - C/C++ - 2008-11-21 11:04:27 阅读(5973) 回复(6)

c# color="red">调用c++(DLL) 为什么c++传汉字, c#不能接收到????? 这是c#color="red">调用(c++ DL)L

by militala - C/C++ - 2008-04-07 21:48:10 阅读(679) 回复(1)

javascript 如何color="red">调用 c/c++ ? 谢谢 :)

by zhujiang73 - C/C++ - 2008-04-12 17:30:42 阅读(2454) 回复(5)

//testcpp.h #include extern "c" { void sample() ; } //testcpp.cpp #include #include #include "testcpp.h" class a { public: a(); }; a::a(){ std::cout<<"it's ok"<cpp #include #include "testcpp.h" int main(){ sample()...

by rickieyangz - C/C++ - 2007-09-14 11:05:20 阅读(2328) 回复(13)

char **ppszTabTokens= (char**)malloc(sizeof(char *)); MYSQL mysql,*sock; TcHAR lpTemp[256]; LPcTSTR szLog; char szSql[256]; MYSQL_ROW row; //存放一行查询结果的字符串数组 MYSQL_RES *res; //查询结果集,结构类型 //char szSql2[256]; mysql_init(&mysql); if (!(sock = mysql_real_connect(&mysql,"localhost","root","123456","Mail",0,NULL,0))) { sprintf(lpTemp,"conncet is failed:%...

by flaght - C/C++ - 2009-03-09 15:56:01 阅读(690) 回复(0)

a.h [code]#ifndef __A__ #define __A__ #include "b.h" class First { public: First(); private: Second *se; }; #endif[/code] a.cpp #include "a.h" First::First() { se = new Second(); } int main() { First str; } ~ ~ b.h #ifndef __B__ #define __B__ #include "a.h" class Second { friend class First; public: Second(); private: First *s...

by ruchong - C/C++ - 2007-05-17 09:40:06 阅读(966) 回复(2)

以Windows平台下使用Visual c++6.0为例 c代码:如FOO.c #include /* Define the method table. */ static PyObject *foo_bar(PyObject *self, PyObject *args); static PyMethodDef FooMethods[] = {{"bar", foo_bar, METH_VARARGS},{NULL, NULL}}; /* Here's the initialization function. We don't need to do anything for our own needs, but Python needs that method table. */ void initfoo() { (void) Py_InitModule(...

by linxh - Python文档中心 - 2006-10-02 01:15:45 阅读(800) 回复(0)

用systemcolor="red">调用shell,但shell执行时间很长,怎样在shell执行期间不让color="red">调用程序能进行其他操作?

by duding1972 - C/C++ - 2006-07-12 00:23:16 阅读(1108) 回复(2)