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

Ò»¸öC++µ÷ÓÃCµÄÀý×Ó

//cExample.h
#ifndef C_EXAMPLE_H
#define C_EXAMPLE_H
#ifdef __cplusplus
extern "C"
{
#endif
int add(int x, int y);
#ifdef __cplusplus
}
#endif
#endif
---------------------------------
//cExample.c
#include"cExample.h"
int add(int x, int y)
{
 return x + y;
}
---------------------------------
//cppFile.cpp
#include <iostream>
#include"cExample.h"
using namespace std;
main()
{
    cout<<add(2,3)<<endl;
    return 0;
}
--------------------------------
//makefile
cppFile: cppFile.o cExample.o
    g++ -g -o cppFile cppFile.o cExample.o
cppFile.o: cppFile.cpp
    g++ -g -c cppFile.cpp
cExample.o: cExample.c cExample.h
    gcc -g -c cExample.c
clean:
    rm -f *.o cppFile


Ïà¹ØÎĵµ£º

c sharp ÎÞ·¨µ÷ÓÃdll

Ô­À´ÊDZ»µ÷ÓõÄdllÓÖµ÷ÓÃÁËÆäËûµÄdll
µÚ¶þ¸ödllÍü¼ÇÁË¿¼µ½¹¤×÷Ŀ¼ÏÂ
µ¼ÖÂÁËc sharpһֱûÄܼÓÔØdll¡£±¨´í£ºÕÒ²»µ½dll
ÏÖÔÚÏëÆðÀ´£¬ËùνµÄdllÕÒ²»µ½£¬Ó¦¸ÃÊÇÕÒ²»µ½µÚ¶þ¸ödll
ÏûºÄʱ¼ä2¸öСʱ£¬ÐÄÇéÉÔ΢ÓеãÊÜÓ°Ïì ......

ºÃÉñÆæµÄ extern "C" Ŷ¡£¡£¡£

ÓÐ¹Ø extern "C"

¸ã¹ýCºÍC++»ì±àµÄͬ־ÃǶ¼ÖªµÀÕâ¸öɶÒâ˼¡£
Õâ¶ùÓн²£ºhttp://www.cppblog.com/Macaulish/archive/2008/06/17/53689.html

µ«¿´Ò»ÏÂÏÂÃæµÄÕâ¸ö´úÂ룺

#include <iostream>
using namespace
std;

extern "C" { int g_inta; }

int main (void)
{
g_ ......

c++ mysql

/*
 * test.cpp
 *
 *  Created on: 2010-5-13
 *      Author: Sarah
 */
  #include   "/usr/include/mysql/mysql.h"   /*Ϊ¾ø¶Ô·¾¶*/
  #include   <stdio.h>
#include <stdlib.h>
#i ......

ʹÓÃNDK¿ª·¢C/C++ÏîÄ¿¹æÔò(ZT)

ʹÓÃNDK¿ª·¢C/C++ÏîÄ¿¹æÔò
<!-- /* Font Definitions */ @font-face {font-family:ËÎÌå; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;}@font-face {font-family:"\@ËÎÌå&qu ......

C Runtime LibraryÏê½â

.¸ÅÂÛ
¡¡¡¡ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÔËÐÐʱ¿âÊÇÒÔLIB»òDLLÐÎʽÌṩµÄ¡£
    CÔËÐÐʱ¿âµ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬µ±Ê±µÄ³ÌÐòÊÀ½ç»¹ºÜµ¥´¿£¬Ó¦ÓóÌÐò¶¼Êǵ¥Ï̵߳쬶àÈÎÎñ»ò¶àÏ̻߳úÖÆÔÚ´Ëʱ»¹ÊôÓÚйÛÄî¡£ËùÒÔÕâ¸öʱÆÚµÄCÔËÐÐʱ¿â¶¼Êǵ¥Ï̵߳ġ£
¡¡¡¡Ëæ×ŲÙ×÷ϵͳ¶àÏ̼߳¼ÊõµÄ·¢Õ¹£¬×î³õµÄCÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ