Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÈçºÎд³öרҵµÄCÍ·Îļþ

×öµ½×¨Òµ£¬Ó¦¸ÃÊÇÿ¸öÖ°Òµ³ÌÐòÔ±Ó¦¸ÃÒªÇó×Ô¼º×öµ½µÄ¡£
ÈÃÎÒÃÇ¿´¿´lua
ÊÇ
ÔõôдͷÎļþµÄ¡£
1.License Agreement
License
Agreement
Ó¦¸Ã¼ÓÔÚÿ¸öÍ·ÎļþµÄ¶¥²¿¡£
Lua Sample:
/*
** $Id: lua.h,v 1.175b 2003/03/18 12:31:39 roberto Exp $
** Lua - An Extensible Extension Language
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
** 
http://www.lua.org
    mailto:info@lua.org
** See Copyright Notice at the end of this file
*/
2.guard define
Õû¸öÍ·ÎļþÓ¦¸ÃÔÚguard
define
Ö®¼ä
#ifndef lua_h
#define
 lua_h
#endif
 ÁíÍ⣬Èç¹ûÕâ¸öÍ·Îļþ¿ÉÄܸø
c++
ʹÓã¬Òª¼ÓÉÏ
#ifdef __cplusplus
extern
 
"
C
"
 {
#endif
/*
The lines within extern "C" 
*/
#ifdef __cplusplus
}
#endif
3.
¾¡Á¿²»ÒªÔÚÍ·ÎļþÖб©Â¶Êý¾Ý½á¹¹
ÕâÑù¿ÉÒÔÓû§¶ÔÄãµÄʵÏÖµÄÒÀÀµ£¬Ò²¼õÉÙÁËÓû§µÄ±àÒëʱ¼ä
typedef 
struct
 lua_State lua_State;
LUA_API lua_State 
*
lua_open (
void
);
LUA_API 
void
       lua_close (lua_State 
*
L);
 ¿ÉÒÔ¿´µ½ËäÈ»Óû§»áһֱʹÓÃ
lua_State,
µ«ÊDz¢²»ÖªµÀ
lua_State
µÄ
½á¹¹ÊÇʲô
´ÓÒ»¸öʹÓÃ
lua
µÄÀý×Ó³ÌÐò¿ÉÒÔ¿´³ö£º
#include 
"
lua.h
"
#include 
"
lauxlib.h
"
#include 
"
lualib.h
"
 
int
 main(
int
 argc, 
char
 
*
argv[])
{
    lua_State 
*

=
 lua_open();
    
const
 
char
 
*
buf 
=
 
"
var = 100
"
;
    
int
 var ;
    luaopen_base(L);
    luaopen_io(L);
    lua_dostring(L, buf);
   &n


Ïà¹ØÎĵµ£º

CµÄλÔËËã·û

Óë &£º  ÈκÎλÓÃ&ÔËËãÓë0½áºÏ½á¹ûΪ0£¬Óë1½áºÏ½á¹ûΪÆä±¾Éí£»
»ò | £º  ÈκÎλÓÃ|ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏ½á¹ûΪ1£»
Òì»ò  ^ £º  ÈκÎλÓÃ^ÔËËãÓë0½áºÏ½á¹ûΪÆä±¾Éí£¬Óë1½áºÏÔòÈ¡·´£» ......

¼òÊöCºÍC++³ÌÐòԱѧϰÀú³Ì

¹þ¹þ£¡ÓÐÐÒÔÚÄ³ÍøÕ¾·¢ÏÖÕâÆªÎÄÕ£¬¶Á°Õ£¬¾õµÃÂùÓеÀÀí£¬·¢À´´ó¼ÒÒ»Æð¹²ÃãÖ®    
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½£¬ÈçºÎѧϰCºÍC++²Å²»Ã£È»£¬²Å²»ÊÇÂÒѧ£¬ÏëÁËһϣ¬ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£ 
' J$ |0 ?! p% w" t5 D6 D: c9 |0 B
¡¡¡¡Ò»¼ÒÖ®ÑÔ£¬»¶Ó­ÅÄש¹þ¡£ 
¡¡¡¡1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC. 
/ U$ X+ X/ P; Y ......

ÓÃC/C++³ÌÐò¿ØÖÆ»·¾³±äÁ¿

In C++, how do i go about using setenv to set the display?  I need to set it like this:
export DISPLAY=0.0
1¡¢setenv("DISPLAY",":0.1",1);
If you're calling the xrandr functions from your C++ program, then I would expect setenv() should work for you. The 3rd argument of 1 tells setenv() to ov ......

Óà Eclipse ¿ª·¢C/C++

ÒªÏëÓÃeclipse¿ª·¢C/C++ Ê×ÏÈÒªÅäÖÃÒ»¸öC/C++µÄ±àÒë»·¾³£¬ÒòΪeclipse×ÔÉíÊDz»´øµÄ¡£ ÐèÒªÏÂÃæÕâÁ½¸ö±Ø²»¿ÉÉٵŤ¾ß 1.±àÒ빤¾ß MinGW£ºhttp://www.mingw.org/             Ö±½ÓÏÂÔØµØÖ·£ºhttp://sourceforge.net/projects/mingw/files/ 2.eclipse²å¼þ CDT £ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ