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

ʹÓÃCÓïÑÔÀ©Õ¹Python(¶þ)

ÔÚÉÏһƪÖÐÎÒÃÇÒѾ­Ê¹ÓÃcÓïÑÔʵÏÖÁËÒ»¸ö×î¼òµ¥µÄÀ©Õ¹Ä£¿é£¬ÕâһƪÖн«ÔÚÆä»ù´¡ÉϽøÐй¦Äܵķḻ¡£Ê×ÏÈÀ´¿¼ÂÇÈçºÎ´ÓÍⲿµÄPythonÏòCÄ£¿é´«µÝ½ø²ÎÊý£¬foo_bar2չʾÁËÈçºÎÏòCÄ£¿é´«µÝÕûÊý£¬¸¡µãÊý£¬×Ö·û´®Èý¸ö²ÎÊý£¬ÆäÖÐ"ids"Ö¸Ã÷ÁË´«Èë²ÎÊýµÄÊý¾ÝÀàÐÍ¡£PyArg_ParseTuple¸ºÔð¶Ôargs½øÐнâÎö£¬Èô½âÎöʧ°ÜÔò·µ»Ø0.´úÂë#include <Python.h>
static PyObject* foo_bar(PyObject* self, PyObject* args) {
    Py_RETURN_NONE;
}
static PyObject* foo_bar2(PyObject* self, PyObject* args) {
    int iNum;
    double fNum;
    char* str;
    if (!PyArg_ParseTuple(args, "ids", &iNum, &fNum, &str)) {
        return NULL;
    }
    Py_RETURN_NONE;
}
static PyMethodDef foo_methods[] = {
    {"bar",(PyCFunction)foo_bar,METH_NOARGS,NULL},
    {"bar2", (PyCFunction)foo_bar2,METH_VARARGS,NULL},
    {NULL,NULL,0,NULL}
};
PyMODINIT_FUNC initfoo() {
    Py_InitModule3("foo", foo_methods, "My first extension module.");
} Ä㻹¿ÉÒÔÖ¸¶¨¿ÉÑ¡µÄ²ÎÊý£¬Ö»ÐèҪͨ¹ýÔÚ¸ñʽ×Ö·û´®Öаüº¬Ò»¸ö"|"×Ö·û¼´¿É£¬ÈçÏÂËùʾ:´úÂëstatic PyObject* foo_bar2(PyObject* self, PyObject* args) {
    int iNum;
    double fNum;
    char* str;
    int iNum2 = 4;
    double fNum2 = 5.0;
    char *str2 = "hello";
    if (!PyArg_ParseTuple(args, "ids|ids", &iNum, &fNum, &str,&iNum2, &fNum2, &str2)) {


Ïà¹ØÎĵµ£º

symbianÒýÓÃC±ê×¼¿â

symbianÓÐ×Ô¼ºµÄÒ»Ì׿⡣ҪºÃµÄ³ÉÐ͵ÄC´úÂ룬±ÈÈçǰÁ½ÌìΪÁ˽âÎöXMLÎÒÒýÓõ½µÄtinyxml¡£ËùÒÔÔÚsymbianÏÂÒýÓÃC±ê×¼¿â¾Í·Ç³£ÖØÒª£¬ÕâÊǶÔÒÔǰ´úÂë·Ç³£ºÃµÄÒÆÖ²·½Ê½¡£
ΪÁËÄÜÓÃC±ê×¼¿â£¬Ö÷ÒªÐÞ¸ÄmmpÎļþÖеÄ·¾¶ºÍ¿âÅäÖá£Ìí¼ÓÈçÏÂÁ½ÐУ¬¾Í¿ÉÒÔÓÃC±ê×¼¿âÁË¡£
SYSTEMINCLUDE  /epoc32/include/stdapis
LIBRARY  ......

C/C++ÖÐ ºê¶¨Òå×Ö·û´® ²Ù×÷

¹ØÓڼǺÅÕ³Ìù²Ù×÷·û(token paste operator): ##
1. ¼òµ¥µÄ˵£¬“##”ÊÇÒ»ÖÖ·Ö¸ôÁ¬½Ó·½Ê½£¬ËüµÄ×÷ÓÃÊÇÏÈ·Ö¸ô£¬È»ºó½øÐÐÇ¿ÖÆÁ¬½Ó¡£
   ÆäÖУ¬·Ö¸ôµÄ×÷ÓÃÀàËÆÓÚ¿Õ¸ñ¡£ÎÒÃÇÖªµÀÔÚÆÕͨµÄºê¶¨ÒåÖУ¬Ô¤´¦ÀíÆ÷Ò»°ã°Ñ¿Õ¸ñ
   ½âÊͳɷֶαêÖ¾£¬¶ÔÓÚÿһ¶ÎºÍÇ°Ãæ±È½Ï£ ......

C\C++ byte»òÕßcharÊý×éתintÖµ

¼ÙÉèÓÐchar a[2];
ÈçÒª°Ñaת»»ÎªintÖµ¡£Ó¦ÊÇÈçÏÂд·¨int b=*(int *)a;
¼´£¬ÏȰÑÖ¸Õëa ת»»ÎªÒ»¸öintÖ¸Õ룬ȻºóÔÙ´Ë»ù´¡ÉÏȡֵ¡£
µ«ÊÇÁíÒ»ÖÖд·¨ int b=(int)(*a);ÊDz»¶ÔµÄ£¬*a È¡aµÄÄÚ´æµ¥ÔªÄÚÈÝ£¬ÒòΪÏÖÔÚaÊÇcharÖ¸Õ룬ËùÒÔÖ»»áÈ¡a[1]ÖÐÄÚÈÝ£¬×î´óΪ255. ÕâÀïҪ˵Ã÷µÄÊÇ£¬ÔÚ°Ñchar»òbyteÊý×éת»»ÎªÆäËûÀàÐ͵Äֵʱ£¬ÒªÏÈ ......

C³ÌÐòÔ±µÄÇéÊé

#include <stdio.h>
#include <string.h>
int
main(void)
{
char str[] =
"3BVPSq4xF.K?=u#,"
"G'K<MrDnRr7gH%#,"
"XKf<f%G`w^=?C<#,"
"HgU_AnNR?*PDQU#,"
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ