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

Python±Ê¼Ç£¨Ò»£©——C/C++µ÷ÓÃpython

×î½üÒòΪÑо¿Ò»¸ö¶«Î÷£¬²¢ÇÒÔںܾÃÒÔÇ°¾ÍÏë°ÑpythonºÃºÃ¿´¿´¡£ÕýºÃÂú×ãÎҵĺÃÆæÐÄ¡£ÎÒÿÌìÉÏ°à×öµÃÓÎÏ·¶¼ÊÇÓÃlua£¬Ò²ÊÇÒ»ÃźÜÇ¿´óµÄ½Å±¾ÓïÑÔ¡£¿ÉÄÜÎÒ¸üϲ»¶pythonµÄËõ½øÇø·ÖºÍÃæÏò¶ÔÏó°É¡£ ½ñÌìֻдһ¸ö¼òµ¥µÄÀý×Ó¡£Ò»¸ö¼òµ¥µÄpython½Å±¾£¬¾ÍÒ»¸öº¯Êý£¬ÓÃC/C++È¥µ÷Ó᣿ÉÄÜÕâÒ²ÊÇ×÷Ϊ³ÌÐòÀ´Ëµ×î¹ØÐĵÄÒ»¼þÊ¡£ËùÒÔÎÒµÄpython±Ê¼ÇÒ²¾Í×îÏÈдÕâ¿é¡£- -  ºÃÇÐÈëÕýÌ⣺
#include <Python.h>
#include <stdio.h>
void test( void )
{
    PyObject *pMod    = NULL;
    PyObject *pFun    = NULL;
    PyObject *pParm   = NULL;
    PyObject *pRetVal = NULL;
    int iRetval       = 0;
    if ( pMod = PyImport_ImportModule( "add" ) )
    {
        if ( pFun = PyObject_GetAttrString( pMod, "add" ) )
        {
            pParm = PyTuple_New( 2 );
            PyTuple_SetItem( pParm, 0, Py_BuildValue( "i", 300 ) );
            PyTuple_SetItem( pParm, 1, Py_BuildValue( "i", 500 ) );
            pRetVal = PyEval_CallObject( pFun, pParm );
            PyArg_Parse( pRetVal, "i", &iRetval );
            printf( "result: %d\n", iRetval );
        }
        else
            printf( "Not found fun!\n" );
    }
    else
        printf( "Not found module!\n" );
}
int main( void )
{
    Py_Initialize();
 &n


Ïà¹ØÎĵµ£º

C/C++/VC ʵÏÖ×Ö·û´®ÄæתµÄ¶àÖÖ·½·¨

/¼ÓÁËÏÂÃæÁ½¸öÍ·Îļþ£¬ÊÇΪÁËÔÚWin32¹¤³ÌÖÐʹÓÃMFCµÄÌØÐÔ!
#include <afx.h>
#include <afxwin.h>
#include "stdio.h"
#include "conio.h"
////¼ÓÁËÏÂÃæÁ½¾ä£¬ÊÇΪÁËÄܹ»ÓÃstring(basic_stringÀàÐÍ)
#include <string>
using namespace std;
int main(int argc, char* argv[ ......

c/c++ÃæÊÔÌâ

½ñÌìÈ¥ÃæÊÔÒ»¼Ò¹«Ë¾£¬ÌîÁËÒ»·Ý“»§¿Úµ÷²é”£¬È»ºó¾ÍÊÇ×öÒ»·ÝÃæÊÔÌ⣬ÌâÄ¿ºÜ¼òµ¥
1¡¢¸Ä´íÌ⣬¸øÒ»¶Î³ÌÐò£¬Ö¸³ö´íÎó
2¡¢Socket×èÈûºÍ·Ç×èÈû±à³Ì£¬·Ç×èÈûµÄʵÏÖÔ­Àí
3¡¢TCP/IPÓëOSIÆß²ãÄ£ÐÍ
TCP/IP²Î¿¼Ä£Ð͹²ÓÐÎå²ã£ºÓ¦Óò㡢´«Êä²ã¡¢»¥ÁªÍø²ãºÍÖ÷»úÖÁÍøÂç²ã¡£
ÓëOSI²Î¿¼Ä£ÐÍÏà±È£¬TCP/IP²Î¿¼Ä£ÐÍûÓбíʾ²ãºÍ» ......

LinuxÏÂc¿ª·¢ Ö® Ïß³ÌͨÐÅ

1.Linux“Ï߳̔
     ½ø³ÌÓëÏß³ÌÖ®¼äÊÇÓÐÇø±ðµÄ£¬²»¹ýLinuxÄÚºËÖ»ÌṩÁËÇáÁ¿½ø³ÌµÄÖ§³Ö£¬Î´ÊµÏÖÏß³ÌÄ£ÐÍ¡£LinuxÊÇÒ»ÖÖ“¶à½ø³Ìµ¥Ï߳̔µÄ²Ù×÷ϵͳ¡£Linux±¾ÉíÖ»Óнø³ÌµÄ¸ÅÄ¶øÆäËùνµÄ“Ï߳̔±¾ÖÊÉÏÔÚÄÚºËÀïÈÔÈ»Êǽø³Ì¡£
     ´ó¼Ò ......

GDB ʹÓ×—Linux C±à³Ì

¼òÊö
    Ò» ÁÐÎļþÇåµ¥
    ¶þ£ºÖ´ÐгÌÐò
    Èý£ºÏÔʾÊý¾Ý
    ËÄ£º¶Ïµã(breakpoint)
    Î壮¶ÏµãµÄ¹ÜÀí
    Áù£®±äÁ¿µÄ¼ì²éºÍ¸³Öµ
    Æß. µ¥²½Ö´ÐÐ
    °Ë£®º¯ÊýµÄµ÷ÓÃ
 &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ