pythonºÍc++»ìºÏ±à³ÌµÄÒ»¸ö±È½Ï¼òµ¥µÄÎÊÌâ ´ó¼ÒÀ´¿´¿´
#include "stdafx.h"
#include <boost/python/def.hpp>
#include <boost/python/module.hpp>
#include <boost/python/args.hpp>
#include <boost/python/class.hpp>
#include <boost/python/str.hpp>
#include <boost/python/dict.hpp>
#include <iostream>
#include <string>
#include <list>
#include <map>
using namespace std;
PyObject * RepeatString (PyObject *pSelf, PyObject *pParams)
{
char *pstrString;
int iRepCount;
PyArg_ParseTuple(pParams, "si", &pstrString, &iRepCount);
for (int i = 0; i < iRepCount; i++)printf("---%d\n", i);
return PyInt_fromLong(iRepCount);
}
int _tmain(int argc, _TCHAR* argv[])
{
Py_Initialize();
Py_IsInitialized();
PyImport_AddModule("HostAPI");
//create a function table
PyMethodDef HostAPIFuncs [] =
{
{"RepeatString", RepeatString, METH_VARARGS, NULL},
{NULL, NULL, NULL, NULL}
};
//initial the module with the function table
Py_InitModule("HostAPI", HostAPIFuncs);
PyObject *pName = PyString_fromString("helloworld");
PyObject * pModule = PyImport_Import(pName);
PyObject *pstr= NUL
Ïà¹ØÎÊ´ð£º
±àÒëÆ÷£ºC-Free4
mysql µ¥¶À°²×°µÄ£¬ÏÖÔÚΪapache+php+mysql¿ÉÒÔʹÓá£
×î½üÔÚÁ·Ï°c£¬c++£»ÏëÓÃc£¬c++Á¬½ÓÏÂÎÒµÄmysql£¬ºÃ¶àµØ·½¶à˵mysql.hÕÒ²»µ½¡£¶øÇÒÎÒmysqlûÓÐËùνµÄincludeÎļþ¼Ð°¡¡£
Íü¸ßÊÖÖ¸µãÒ»¶ ......
ÒÑÖªPython ÖУº
s = unicode("²âÊÔ", "gb2312")
s = u'\u6d4b\u8bd5'
print s
²âÊÔ
ÔÚDelphiÀïÃæÈçºÎ½«\u6d4b\u8bd5ÕâÑùµÄ»¹Ô³ÉGb2312µÄºº×ÖÄØ£¿
ÕÒµ½¸ö·½·¨
......
#include "stdio.h"
int main()
{
char *ch(char *, char *);
char str1[]="I am glad to meet you!";
char str2[]="Welcom to study C!";
&nb ......
ÎÒÊÇÐÂÊÖ£¬³õѧMYSQL£¬Óкܶ಻¶®£¬Íû´Í½Ì£¡£¡
±ÈÈç˵ÎÒн¨Ò»¸öMYSQLÊý¾Ý¿âUSER Êý¾Ý¿âÖÐÓбíLIST
È»ºóÎÒÔÚVCÖÐн¨Ò»¸öMFC¶Ô»°¿ò¹¤³Ì£¬È»ºóÎÒÔõôÑù²ÅÄÜÓÃVC»ñµÃÊý¾Ý¿âÖбíµÄÊý¾Ý£¿
Ï£Íû¸ø³ö¾ßÌåµÄ²Ù×÷² ......
ÓÉÓÚÎҲŸոսӴ¥socket±à³Ì£¬×Ô¼ºÐ´ÁËÒ»¸ö¼òµ¥³ÌÐò£¬µ«¾ÍÊÇÔÚÔËÐеÄʱºò³öÏֶδíÎó£¬ÎÞ·¨½â¾ö£¬ÏÖÔÚÎÒ°ÑÔ´´úÂëÌù³öÀ´£¬Çë¸÷λ´óϺָÕýһϣ¡Ð»Ð»£¡
#include<stdio.h>
#include<stdlib.h>
#include& ......