C typedefÏê½â¼°Óë#defineµÄÇø±ð
typedef ÉùÃ÷£¬¼ò³Æ typedef£¬ÎªÏÖÓÐÀàÐÍ´´½¨Ò»¸öеÄÃû×Ö¡£±ÈÈçÈËÃdz£³£Ê¹Óà typedef À´±àд¸üÃÀ¹ÛºÍ¿É¶ÁµÄ´úÂë¡£ËùνÃÀ¹Û£¬ÒâÖ¸ typedef ÄÜÒþ²Ø±¿×¾µÄÓï·¨¹¹ÔìÒÔ¼°Æ½Ì¨Ïà¹ØµÄÊý¾ÝÀàÐÍ£¬´Ó¶øÔöÇ¿¿ÉÒÆÖ²ÐÔºÍÒÔ¼°Î´À´µÄ¿Éά»¤ÐÔ¡£
µÚÒ»¡¢ËĸöÓÃ;
ÓÃ;һ£º
¶¨ÒåÒ»ÖÖÀàÐ͵ıðÃû£¬¶ø²»Ö»ÊǼòµ¥µÄºêÌæ»»¡£¿ÉÒÔÓÃ×÷ͬʱÉùÃ÷Ö¸ÕëÐ͵Ķà¸ö¶ÔÏó¡£±ÈÈ磺
char* pa, pb; // Õâ¶àÊý²»·ûºÏÎÒÃǵÄÒâͼ£¬ËüÖ»ÉùÃ÷ÁËÒ»¸öÖ¸Ïò×Ö·û±äÁ¿µÄÖ¸Õ룬
// ºÍÒ»¸ö×Ö·û±äÁ¿£»
ÒÔÏÂÔò¿ÉÐУº
typedef char* PCHAR; // Ò»°ãÓôóд
PCHAR pa, pb; // ¿ÉÐУ¬Í¬Ê±ÉùÃ÷ÁËÁ½¸öÖ¸Ïò×Ö·û±äÁ¿µÄÖ¸Õë
ËäÈ»£º
char *pa, *pb;
Ò²¿ÉÐУ¬µ«Ïà¶ÔÀ´ËµÃ»ÓÐÓÃtypedefµÄÐÎʽֱ¹Û£¬ÓÈÆäÔÚÐèÒª´óÁ¿Ö¸ÕëµÄµØ·½£¬typedefµÄ·½Ê½¸üÊ¡Ê¡£
ÓÃ;¶þ£º
ÓÃÔھɵÄCµÄ´úÂëÖУ¨¾ßÌå¶à¾ÉûÓв飩£¬°ïÖústruct¡£ÒÔÇ°µÄ´úÂëÖУ¬ÉùÃ÷structжÔÏóʱ£¬±ØÐëÒª´øÉÏstruct£¬¼´ÐÎʽΪ£º struct ½á¹¹Ãû ¶ÔÏóÃû£¬È磺
struct tagPOINT1
{
int x;
int y;
};
struct tagPOINT1 p1;
¶øÔÚC++ÖУ¬Ôò¿ÉÒÔÖ±½Óд£º½á¹¹Ãû ¶ÔÏóÃû£¬¼´£º
tagPOINT1 p1;
¹À¼ÆijÈ˾õµÃ¾³£¶àдһ¸östructÌ«Âé·³ÁË£¬ÓÚÊǾͷ¢Ã÷ÁË£º
typedef struct tagPOINT
{
int x;
int y;
}POINT;
POINT p1; // ÕâÑù¾Í±ÈÔÀ´µÄ·½Ê½ÉÙдÁËÒ»¸östruct£¬±È½ÏÊ¡Ê£¬ÓÈÆäÔÚ´óÁ¿Ê¹ÓõÄʱºò
»òÐí£¬ÔÚC++ÖУ¬typedefµÄÕâÖÖÓÃ;¶þ²»ÊǺܴ󣬵«ÊÇÀí½âÁËËü£¬¶ÔÕÆÎÕÒÔÇ°µÄ¾É´úÂ뻹ÊÇÓаïÖúµÄ£¬±Ï¾¹ÎÒÃÇÔÚÏîÄ¿ÖÐÓпÉÄÜ»áÓöµ½½ÏÔçЩÄê´úÒÅÁôÏÂÀ´µÄ´úÂë¡£
ÓÃ;Èý£º
ÓÃtypedefÀ´¶¨ÒåÓëƽ̨Î޹صÄÀàÐÍ¡£
±ÈÈ綨ÒåÒ»¸ö½Ð REAL µÄ¸¡µãÀàÐÍ£¬ÔÚÄ¿±êƽ̨һÉÏ£¬ÈÃËü±íʾ×î¸ß¾«¶ÈµÄÀàÐÍΪ£º
typedef long double REAL;
ÔÚ²»Ö§³Ö long double µÄƽ̨¶þÉÏ£¬¸ÄΪ£º
typedef double REAL;
ÔÚÁ¬ double ¶¼²»Ö§³ÖµÄƽ̨ÈýÉÏ£¬¸ÄΪ£º
typedef float REAL;
Ò²¾ÍÊÇ˵£¬µ±¿çƽ̨ʱ£¬Ö»Òª¸ÄÏ typedef ±¾Éí¾ÍÐУ¬²»ÓöÔÆäËûÔ´Âë×öÈκÎÐ޸ġ£
±ê×¼¿â¾Í¹ã·ºÊ¹ÓÃÁËÕâ¸ö¼¼ÇÉ£¬±ÈÈçsize_t¡£
ÁíÍ⣬ÒòΪtypedefÊǶ¨ÒåÁËÒ»ÖÖÀàÐ͵ÄбðÃû£¬²»ÊǼòµ¥µÄ×Ö·û´®Ìæ»»£¬ËùÒÔËü±ÈºêÀ´µÃÎȽ¡£¨ËäÈ»ÓúêÓÐʱҲ¿ÉÒÔÍê³ÉÒÔÉϵÄÓÃ;£©¡£
ÓÃ;ËÄ£º
Ϊ¸´ÔÓµÄÉùÃ÷¶¨ÒåÒ»¸öеļòµ¥µÄ±ðÃû¡£·½·¨ÊÇ£ºÔÚÔÀ´µÄÉùÃ÷ÀïÖð²½ÓñðÃûÌæ»»Ò»²¿·Ö¸´ÔÓÉùÃ÷£¬Èç´ËÑ»·£¬°Ñ´ø±äÁ¿ÃûµÄ²¿·ÖÁôµ½×îºóÌæ»»£¬µÃµ½µÄ¾ÍÊÇÔÉùÃ÷µÄ×î¼ò»¯°æ¡£¾ÙÀý£º
1. ÔÉùÃ÷£ºint *(*a[5])(int, char
Ïà¹ØÎĵµ£º
CÓïÑÔÎļþ²Ù×÷½Ó´¥ºÜ¾ÃÁË£¬Ò»Ö±Ã»ÓÐ×ܽáÏà¹ØÄÚÈÝ£¬½ñÌìÓõ½Á˾ÍÈ¥ÕÒÁËÕÒÏà¹ØÄÚÈÝ¡£
ÔÚANSI CÖУ¬¶ÔÎļþµÄ²Ù×÷·ÖΪÁ½ÖÖ·½Ê½£¬¼´Á÷ʽÎļþ²Ù×÷ºÍI/OÎļþ²Ù×÷
typedef struct {
int level; /* fill/empty level of buffer */
unsigned flags; /* File status flags */
char fd; /* File descriptor */
unsigned char hold ......
1¡¢¿ª·¢»·¾³Çë²Î¿¼¡¶´î½¨ACE-5.7.4+VS2008¿ª·¢»·¾³¡·Ò»ÎÄ
2¡¢gSOAP¿â£¬ÏÂÔصØÖ·£ºhttp://gsoap2.sourceforge.net/£¬±¾ÎÄʹÓõİ汾ÊÇ£ºgsoap_2.7.15£¬gSOAPµÄ±à³Ì¿ÉÒԲο¼docĿ¼ÏµÄsoapdoc2.pdf£¬¹Ù·½ÎĵµÐ´µÄ·Ç³£Ïêϸ¡£
ÈÃÎÒÃÇ¿ªÊ¼gSOAP±àÂëÂọ́º
1¡¢´´½¨gsoap_server.h£º
//gsoap ns2 service namespace: http://l ......
ÔÚCÓïÑÔÖУ¬ËùÓд«µÝ¸øº¯ÊýµÄ²ÎÊý¶¼ÊÇ°´Öµ´«µÝµÄ¡£
#include <iostream>
using namespace std;
void Out(int* p)
{
int j = 11;
p = &j;
*p = 12;
cout<<*p<<endl;
}
int main(int argc,char*argv[])
{
&n ......
1.ÒýÑÔ
C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better
C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌص㣨±»ÊÀÈ˳ÆΪ“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï¾ ......