Ò»¸ö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
Ïà¹ØÎĵµ£º
ÔÀ´ÊDZ»µ÷ÓõÄdllÓÖµ÷ÓÃÁËÆäËûµÄdll
µÚ¶þ¸ödllÍü¼ÇÁË¿¼µ½¹¤×÷Ŀ¼ÏÂ
µ¼ÖÂÁËc sharpһֱûÄܼÓÔØdll¡£±¨´í£ºÕÒ²»µ½dll
ÏÖÔÚÏëÆðÀ´£¬ËùνµÄdllÕÒ²»µ½£¬Ó¦¸ÃÊÇÕÒ²»µ½µÚ¶þ¸ödll
ÏûºÄʱ¼ä2¸öСʱ£¬ÐÄÇéÉÔ΢ÓеãÊÜÓ°Ïì ......
²Ù×÷²½Ö裺
1.ÎïÀí»ú°²×°VMWare£¬ÔÚÐéÄâ»úÖа²×°Windows XP Professional + SP2
2.VM->Install VMware Tools...
3.ÔÚVMwareÖ÷½çÃæË«»÷Ethernet£¬²¢Ñ¡¶¨Host-onlyÑ¡Ïî
4.ÔÚÎïÀí»úÍøÂçÁ¬½ÓÖУ¬ÉèÖÃVMware Network Adapter VMnet1µÄIPµØַΪ£º130.0.0.50£¬×ÓÍøÑÚÂ룺255.255.0.0£¬ÆäÓàΪ¿Õ£¬×÷Ϊ²Ù×÷վʹÓá£Í¬Ê±½ûÓÃVM ......
/*
* test.cpp
*
* Created on: 2010-5-13
* Author: Sarah
*/
#include "/usr/include/mysql/mysql.h" /*Ϊ¾ø¶Ô·¾¶*/
#include <stdio.h>
#include <stdlib.h>
#i ......
1.·Ö²ãÉè¼Æ£¬¸ôÀëƽ̨Ïà¹ØµÄ´úÂë¡£¾ÍÏñ¿É²âÊÔÐÔÒ»Ñù£¬¿ÉÒÆÖ²ÐÔÒ²Òª´ÓÉè¼Æ×¥Æð¡£Ò»°ãÀ´Ëµ£¬×îÉϲãºÍ×îϲ㶼²»¾ßÓÐÁ¼ºÃµÄ¿ÉÒÆÖ²ÐÔ¡£×îÉϲãÊÇGUI£¬´ó¶àÊýGUI¶¼²»ÊÇ¿çƽ̨µÄ£¬ÈçWin32 SDKºÍMFC¡£×îϲãÊDzÙ×÷ϵͳAPI£¬´ó¶à²¿·Ö²Ù×÷ϵͳAPI¶¼ÊÇרÓõġ£
¡¡¡¡Èç¹ûÕâÁ½²ãµÄ´úÂëÉ¢²¼ÔÚÕû¸öÈí¼þÖУ¬ÄÇôÕâ¸öÈí¼þµÄ¿ÉÖ²ÐÔ½«·Ç³£µÄ² ......
(ת)C/C++ÖеÄÈÕÆÚºÍʱ¼ä time_tÓëstruct tmת»»
ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê ......