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

ÓÃphpµÄcÀ©Õ¹±à³Ìµ÷Óà c³ÌÐòµÄ¶¯Ì¬Á´½Ó¿â


Ò».    Ê×ÏÈ×öÒ»¸ö¼òµ¥µÄsoÎļþ£º
    /**
     * hello.c
     * To compile, use following commands:
     *   gcc -O -c -fPIC -o hello.o hello.c
     *   gcc -shared -o libhello.so hello.o
     */
    int hello_add(int a, int b)
    {
        return a + b;
    }
    È»ºó½«Ëü±àÒë³É.soÎļþ²¢·Åµ½ÏµÍ³ÖУº
    $ gcc -O -c -fPIC -o hello.o hello.c
    $ gcc -shared -o libhello.so hello.o
    $ su
    # echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
    # cp libhello.so /usr/local/lib
    # /sbin/ldconfig
¶þ.    д¶ÎС³ÌÐòÀ´ÑéÖ¤ÆäÕýÈ·ÐÔ£º
    /**
     * hellotest.c
     * To compile, use following commands:
     *   gcc -o hellotest -lhello hellotest.c
     */
    #include <stdio.h>
    int main()
    {
        int a = 3, b = 4;
        printf("%d + %d = %d\n", a, b, hello_add(a,b));
        return 0;
    }
    ±àÒë²¢Ö´ÐУº
    $ gcc -o hellotest -lhello hellotest.c
    $ ./hellotest
    3 + 4 = 7
Èý.
    È»ºóͨ¹ýÏÂÃæµÄÃüÁÁ¢Ò»¸öÃûΪ hello µÄÄ£¿é¡£
    $ ./ext_skel --extname=hello
    Ö´ÐиÃÃüÁîÖ®ºóËü»áÌáʾÄãÓ¦µ±ÓÃʲôÃüÁîÀ´±àÒëÄ£¿é£¬¿ÉϧÄÇÊǽ«Ä£¿é¼¯³Éµ½phpÄÚ²¿µÄ±àÒë·½·¨¡£Èç¹ûÒª±àÒë³É¿É¶¯Ì¬¼ÓÔØµÄ php_hello.so£¬·½·¨Òª¸üΪ¼òµ¥¡£
    $ cd hello
    Ê×Ïȱ༭ config.m4 Îļþ£¬È¥µôµÚ16Ðк͵Ú18ÐÐ


Ïà¹ØÎĵµ£º

[ת]C/C++×ÊÔ´´ó»ã×Ü(ºÜºÃºÜÇ¿´ó)

1.¿ª·¢¹¤¾ßÏÂÔØ
TUBER C                     http://www.duote.com/soft/392.html
Turbo C 2.0 ºº»¯°æ             http://www.programfan.com/showdown.asp?id=306
C-Free 4.0             http:/ ......

C/C++¿ØÖÆÌ¨Êä³öʱÉèÖÃ×ÖÌå¼°±³¾°ÑÕÉ«


1.¸Ä±äÕû¸ö¿ØÖÆÌ¨µÄÑÕÉ«
ÓÃ system("color 0A");
ÆäÖÐcolorºóÃæµÄ0ÊDZ³¾°É«´úºÅ£¬AÊÇǰ¾°É«´úºÅ¡£¸÷ÑÕÉ«´úÂëÈçÏ£º
0=ºÚÉ«
1=À¶É«
2=ÂÌÉ«
3=ºþÀ¶É«
4=ºìÉ«
5=×ÏÉ«
6=»ÆÉ«
7=°×É«
8=»ÒÉ«
9=µ­À¶É«
A=µ­ÂÌÉ«
B=µ­Ç³ÂÌÉ«
C=µ­ºìÉ«
D=µ­×ÏÉ«
E=µ­»ÆÉ«
F=ÁÁ°×É«
 
2.¸Ä±äÏÂÒ»¸öÊä³ ......

C ×Ö·û´®º¯Êý´óÈ«

º¯ÊýÃû: stpcpy
¹¦ ÄÜ: ¿½±´Ò»¸ö×Ö·û´®µ½ÁíÒ»¸ö
ÓÃ ·¨: char *stpcpy(char *destin, char *source);
³ÌÐòÀý:
#include <stdio.h>
#include <string.h>
int main(void)
{
   char string[10];
   char *str1 = "abcdefghi";
   stpcpy(string, str1);
 & ......

C ÃæÊÔÌâÖ®ÕÒ´íÌâ


ÕÒ´íÌâ
¡¡¡¡ÊÔÌâ1£º
void test1()
{
¡¡char string[10];
¡¡char* str1 = "0123456789";
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ2£º
void test2()
{
¡¡char string[10], str1[10];
¡¡int i;
¡¡for(i=0; i<10; i++)
¡¡{
¡¡¡¡str1[i] = 'a';
¡¡}
¡¡strcpy( string, str1 );
}
¡¡¡¡ÊÔÌâ3£º
void test3( ......

PHPÑ­»·Óï¾ä

Ñ­»·Óï¾äÊÇ ÎªÁ˽â¾ö±à³ÌÖÐ "ÐèÒªÖØ¸´Ò»¶ÎÖ¸ÁîÖ±µ½Âú×ãÌØ¶¨Ìõ¼þΪֹ" µÄÒ»ÖÖÑ­»·»úÖÆ
1¡¢while
     whileÓï¾äÖ¸¶¨ÁËÒ»¸öÌõ¼þ£¬ÔÚÆäǶÈë´úÂë½áÊøÖ´ÐÐǰ£¬±ØÐëÂú×ãÕâ¸öÌõ¼þ¡£
     Óï·¨£º
     while(expression){
      & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ