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

extern "C"ÎÊÌâ

/*-----------c.h--------------*/
#ifndef _C_H_
#define _C_H_
extern "C" int add(int x, int y);
#endif

/*-----------c.c--------------*/
int add(int x, int y){
return x+y;
}

/*-----------cpp.cpp--------------*/
#include "c.h"
void main()
{
add(1, 0);
}


ÕâÈý¸öÎļþ·ÅÔÚͬһĿ¼Ï£¬ÓÃVC6´ò¿ªcpp.cppÎļþ±àÒë³É¹¦£¬ÔËÐÐʧ°Ü£¬ÎªÊ²Ã´£¿Ôõô¸Ä£¿
/*-----------c.cpp--------------*/
int add(int x, int y){
return x+y;
}

ÒýÓÃ
/*-----------c.cpp--------------*/
int add(int x, int y){
return x+y;
}

ûÓ𡣬×îºÃ²»¸ÃÎļþÃû

extern C±íÃ÷ÒÔCµ÷Ó÷½Ê½Ö´ÐУ¬Äã±¾Éí¾ÍÊÇC´úÂ룬¼ÓÕâ¸ö¸Éʲô£¿
ºÃÏñÒª¼ÓÒ²ÒªÔÚcppÀïÃæ¼Ó

C/C++ code:
/*-----------c.h--------------*/
extern int add(int x, int y);


/*-----------c.c--------------*/
int add(int x, int y){
return x+y;
}


/*-----------cpp.cpp--------------*/
#include "c.h"

int main()
{
add(1, 0);
return 0;
}

ÊÔÊÔ

C/C++ code:
/*-----------c.h--------------*/
#ifndef _C_H_
#define _


Ïà¹ØÎÊ´ð£º

cµÄ×Ö·û´®ÎÊÌâ

fastshow()
{
FILE *fp;
char name[10];
char ch[512];
printf("ÇëÊäÈë´ýÏÔʾµÄÎļþÃû\n");
scanf("%s",name);
if((fp=fopen(name,"r"))==NULL)
{
printf ......

C³ÌÐòÎÊÌâ

ÓÐÕâÑùÁ½¸öÎÊÌ⣬ϣÍû¸ßÊÖÖ¸µã£º
µÚÒ»£º
struct struct_A{
int a;
char b;
int c;
short d;
}
  struct struct_B{
  int a;
  char b;
  short c;
  ......

ÇóMACËã·¨ c/c++´úÂë

Ëã·¨Á÷³Ì
±¾Îĸù¾Ý¡¶ÖйúÒøÁªÖ±ÁªPOSÖն˹淶¡·µÄ²ûÊö£¬ÓÃCÓïÑÔ±à³ÌʵÏÖ£¬¸ÃËã·¨ÔÚʵ¼ÊµÄÉÌÒµPOSÖÕ¶ËÖÐʹÓá£POSÖն˲ÉÓãţãµļÓÃÜ·½Ê½£¬¼òÊöÈçÏ£º
a) ½«Óû·¢Ë͸øPOSÖÐÐĵÄÏûÏ¢ÖУ¬´ÓÏûÏ¢ÀàÐÍ£¨MTI£©µ½63Ó ......

ÇëÎÊC/SµÄÎïÀí½á¹¹£¿

ÇëÎÊÏÂC/SµÄÎïÀí½á¹¹£¬ÊDz»ÊÇÕâÑùµÄ£º

һ̨·þÎñÆ÷£¬ÉÏÃæÖ»ÔËÐÐÒ»¸öÊý¾Ý¿â£¬È»ºóÊǶà¸ö¿Í»§¶Ë»ú£¬Ã¿¸ö»ú×ÓÉÏ°²×°Ò»¸ö¿Í»§¶ËÈí¼þ£¬ÔÙ°ÑÊý¾Ý¿âÁ¬½ÓÓû§ÃûÃÜÂë¸øÿ¸ö¿Í»§¶Ë£¬Õâ¸öÃÜÂëÓÉÈí¼þ¼ÓÃÜ·ÅÔÚ¿Í»§¶Ë£¬Óû§µ ......

c signalµ÷ÓÃÎÊÌâ

¿ªÊ¼Ñ§OS,°´Á·Ï°ÒªÇóдµÄ´úÂëÔÚgccÏÂÎÞ·¨±àÒ룺

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>

void SIGFPEhandler2(int s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ