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

C³ÌÐòµ÷ÓÃC++º¯Êý

ÕâÖÖÐèÇóÓ¦¸Ã¾ÍûC++³ÌÐòµ÷ÓÃCº¯ÊýÐèÇó¶àÁË.ĿǰµÄʵÏÖ»ù±¾Ö»ÓÐÒ»Àà·½·¨,¼´Í¨¹ý´¦Àí±»µ÷ÓõÄC++Îļþ.
ÎÄ
Öиø³öµÄÈÔÈ»ÊÇÍêÕûµÄ,¾ßÌåµÄ,µ«ÓÖ×î»ù±¾×î¼òµ¥µÄʵÏÖ,ÖÁÓÚÀíÂÛÐԵĶ«Î÷ÔÚÍøÉϺÜÈÝÒ×ËÑË÷µÄµ½.ÕâÀïÊÇÕë¶Ôµ÷ÓÃC++µÄ³ÉÔ±º¯ÊýµÄʵÏÖ.
aa.h
class AA {
    int i;
    public:
        int ThisIsTest(int a, int b); 
        float ThisIsTest(float a, float b);
};
extern "C" int ThisIsTest_C(void* s, int a,int b);
extern "C" float PolymorphicTest_C(void* s,float a, float b);
aa.cpp:
#include "aa.h"
int AA::ThisIsTest(int a, int b){
    return (a + b);
}
float AA::PolymorphicTest(float a, float b){
    return (a+b);
}
int ThisIsTest_C(void* s, int a,int b){
    AA* p = (AA*)s;
    return p->ThisIsTest(a,b);
}
float PolymorphicTest_C(void* s,float a, float b){
    AA* p = (AA*)s;
    return p->ThisIsTest(a,b);
}
a.h:
#ifndef __A_H
#define __A_H
int bar(void* s,int a, int b);
int bar_float(void* s,float a, float b);
#endif
a.c
#include <stdio.h>
#include "a.h"
extern int ThisIsTest_C(void* s, int a,int b);
extern float PolymorphicTest_C(void* s,float a, float b);
int bar(void* s,int a, int b) {
  printf("result=%d\n", ThisIsTest_C(s,a, b));
  return 0;
}
int bar_float(void* s,float a, float b) {
  printf("result=%f\n", PolymorphicTest_C(s,a, b));
  return 0;

main.c:
#include "a.h"
struct S {
  int i;
};
struct S s;
int main(int argc, char **argv){
  int a = 1;
  int b = 2;
  float c = 1.5;
  float d = 1.4;
  bar((void*)&s,a, b);
  bar_float((void*)&s,c,d);
  return(0);
}
Makefile:
all:
    gcc -Wall -c a.c -o a.o
    gcc -Wall -c aa.cpp -o aa.o
    gcc -Wall -c main.c -o main.o
 


Ïà¹ØÎĵµ£º

Pro*C ÖÐǶÈëpl/sql¿é

/* °üº¬CÍ·Îļþ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/* °üº¬SQLCAÍ·Îļþ */
EXEC SQL INCLUDE sqlca;
EXEC SQL INCLUDE sqlda;
int main()
{
    EXEC SQL BEGIN DECLARE SECTION;
    int  money;
    ......

ÈçºÎѧϰlinuxϵÄc/c++±à³Ì

ÎҼƻ®µÄѧϰÀú³Ì£º
1. cºÍc++µÄ»ù´¡ÖªÊ¶£¬Õâ¸öºÍ²Ù×÷ϵͳÎ޹أ¬ÔÚwindowsÉÏÒ²¿ÉÒÔѧ¡£cÓïÑÔÓï·¨Ïà¶Ô¼òµ¥Ò»µã£¬c++²»ÐèÒª°ÑËùÓеÄ֪ʶµã¶¼Ñ§»á£¬ÒªÖªµÀ»ù±¾µÄ·â×°£¬¼Ì³Ð£¬¶à̬֮ÀàµÄ£¬»¹ÓÐSTL¡£¸üÉîÈëµÄѧϰӦ¸ÃÊÇÔÚÒÔºóµÄ¹¤×÷ÖÐÓöµ½ÎÊÌâÁËÔÙÈ¥²é×ÊÁÏ¡£
2. ¿´Êé¡¶APUE¡·£¬×öÊéÉϵÄϰÌâ£¬ÕÆÎÕÎļþ£¬ÏµÍ³µ÷Óã¬Ï̡߳¢½ø³Ì¡¢ ......

Facts of C Programming Language

Facts of C Programming Language
CµÄÒ»Ð©ÕÆ¹Ê
(Ó¢ÎÄÔ­ÎÄ:http://www.programmingfacts.com/2009/12/01/facts-of-c-programming-language/)
C programming language was developed in 1972 by Dennis Ritchie and Brian Kernighan at the Bell Telephone Laboratories (AT&T Bell Laboratories) for use with the Un ......

ceo,cfo,cooȫϵÁеÄcϵÁУ¬ºÜÓÐÒâ˼£¬À´Ñ§Ï°Ò»Ï°É

CEO
CEO£¨Chief Executive Officer£©£¬¼´Ê×ϯִÐй٣¬ÊÇÃÀ¹úÈËÔÚ20ÊÀ¼Í60Äê´ú½øÐй«Ë¾ÖÎÀí½á¹¹¸Ä¸ï´´ÐÂʱµÄ²úÎËüµÄ³öÏÖÔÚijÖÖÒâÒåÉÏ´ú±í׎«Ô­À´¶­Ê»áÊÖÖеÄһЩ¾ö²ßȨ¹ý¶Éµ½¾­Óª²ãÊÖÖС£
ÔÚÎÒ¹ú£¬CEOÕâ¸ö¸ÅÄî×îÔç³öÏÖÔÚÒ»Ð©ÍøÂçÆóÒµÖС£ÔÚÄÇÀCEOÍùÍùÊÇ×Ô·âµÄ£¬Ò²ºÜÉÙÓÐÈËÈ¥Ñо¿ÕâÒ»³ÆÎ½¶ÔÆóÒµµ½µ×Òâζ×Åʲô¡£µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ