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

C: ÃæÏò¶ÔÏó(2)

ÑÝʾÈçºÎÓÃCʵÏּ̳У¬ÖØÔØÖ®ÀàµÄÍæÒÕ¶ù¡£VC++6.0±àÒëͨ¹ý¡£
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef class
        #define class struct
#endif
#ifndef private
        #define private
#endif
#ifndef public
        #define public
#endif
#ifndef protected
        #define protected
#endif
#ifndef bool
        #define bool int
#endif
#ifndef true
        #define true 1
#endif
#ifndef false
        #define false 0
#endif
class Parent{
 //private members
 private class Parent *this;
 private char *name;
 //public members
 public void (*construct)(class Parent *this);
 public bool (*setName)(class Parent *this, const char *name);
 public char* (*getName)(class Parent *this);
 public void (*destruct)(class Parent *this);
};
class Son{
 //private members
 private class Son *this;
 //inherit properties from Parent, we use a pointer here to simulate inheritance
 private class Parent *inherit;
 //add new members
 private char* addr;
//public members
 public bool (*construct)(class Son *this); 
 public bool (*setName)(class Son *this, const char *name);
 public char* (*getName)(class Son *this);
 public bool (*setAddr)(class Son *this, const char *addr);
 public char* (*getAddr)(class Son *this);
 public void (*destruct)(class Son *this);
};
//foward declaration
//-----Members for Parent begin
void ParentConstruct(class Parent *this);
bool setName(class Parent *this, const char *name);
char *getName(class Parent *this);
void ParentDestruct(class Parent *this);
//-----Mmmbers for Parent end
//----Members for Son begin
bool SonConstruct(clas


Ïà¹ØÎĵµ£º

CºÍC++ÓïÑÔѧϰ×ܽá(Ò»)

CºÍC++ÓïÑÔѧϰ×ܽá(Ò»)
֪ʶ½á¹¹:
1¡¢if,for,switch,goto
2¡¢#define,const
3¡¢Îļþ¿½±´µÄ´úÂë,¶¯Ì¬Éú³ÉÄÚ´æ,¸´ºÏ±í´ïʽ,strcpy,memcpy,sizeof
4¡¢º¯Êý²ÎÊý´«µÝ,ÄÚ´æ·ÖÅ䷽ʽ,ÄÚ´æ´íÎó±íÏÖ,mallocÓënewÇø±ð
5¡¢ÀàÖØÔØ¡¢Òþ²ØÓ븲¸ÇÇø±ð,externÎÊÌâ,º¯Êý²ÎÊýµÄȱʡ
ÖµÎÊÌâ,ºê´úÂëÓëÄÚÁªº¯ÊýÇø±ð
6¡¢¹¹ÔìºÍÎö¹ ......

cÓëc++µÄÇø±ð£¨»ù´¡£©

ΪÁËÓÃvcдһ¸ö×î¼òµ¥µÄ socket ³ÌÐò£¬»¨·ÑÁËÒ»¸öÏÂÎçµÄʱ¼ä£¬¹ý³ÌÖгöÏֵĴíÎóÓУº
'SOCKET' : illegal use of this type as an expression
syntax error : missing ';' before 'type'
syntax error : identifier 'InitWinsock'   -->       bool   InitWinsock( ......

ÓÃc¶ÁÈ¡XMLÎļþ

 
¡¡ ¿ÉÒÔ½«XMLÎļþµÄÊ÷(Ö»ÓÐÒ»¸ö¶¥²ã½Úµã).ÓÚÊÇÀíËùµ±È»µÄ¿ÉÒÔÓÃÊ÷×÷ΪXMLµÄÒ»ÖÖ´æ´¢½á¹¹.
ÎÒ½«ÔÚÕâÀïÓÃC++ʵÏÖ¶Ô¼òµ¥µÄXMLÎļþµÄ½âÎö.
1.Ñ¡Ôñ´æ´¢½á¹¹:
Ê÷ÐÍÊý¾Ý½á¹¹ÓжàÖÖ´æ´¢·½Ê½,ÎÒ½«ÓÃ"º¢×ÓÐֵܱíʾ·¨",¶¨ÒåÈçÏÂ:
typedef struct CSNode
{
int subNodes;
string data;
string name;
struct CSNode *fi ......

c sharp ÃüÁîÐеÄÓ÷¨

ʹÓà C# 2.0 ÃüÁîÐбàÒëÆ÷
http://msdn.microsoft.com/zh-cn/library/ms379563(vs.80).aspx#mainSection
ÕªÒª£º±¾ÎÄ·ÖÎöÁËʹÓà C# ÃüÁîÐбàÒëÆ÷ csc.exe Éú³ÉÓ¦ÓóÌÐòµÄ¹ý³Ì¡£Í¬Ê±£¬»¹½«Ïò¶ÁÕß½éÉܺܶàΪ C# 2.0 ¶ÀÓеıàÒëÆ÷Ñ¡ÏÀýÈ磬extended/reference ±êÖ¾ºÍÇ¿Ãû³ÆÖ§³Ö¡£ÔĶÁÍê±¾ÎĵÄÄÚÈÝÖ®ºó£¬Äú½«Äܹ»ÇáËɵØÔÚû ......

linux ³£ÓÃcº¯Êý


opendir£¨´ò¿ªÄ¿Â¼£©
Ïà¹Øº¯Êý
open£¬readdir£¬closedir£¬rewinddir£¬seekdir£¬telldir£¬scandir
±íÍ·Îļþ
#include<sys/types.h>
#include<dirent.h>
¶¨Ò庯Êý
DIR * opendir(const char * name);
º¯Êý˵Ã÷
opendir()ÓÃÀ´´ò¿ª²ÎÊýnameÖ¸¶¨µÄĿ¼£¬²¢·µ»ØDIR*ÐÎ̬µÄĿ¼Á÷£¬ºÍopen()ÀàËÆ£¬½ÓÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ