C ++µÄµ¥Àýģʽ
µ¥Àýģʽ£º¶ÔÓ¦Ò»¸öÀàÖ»ÄÜÉú³ÉÒ»¸ö¶ÔÏó¡£
#include <stdio.h>
class A
{
private:
int id;
A() {}//°Ñ¹¹Ô캯Êý·ÅÔÚprivate£ºÏÂÄ¿µÄÊÇÔÚÀàÍâ²»ÄÜÔÚÕ»ÉÏÖ±½Ó·ÖÅä¿Õ¼ä¶¨Òå¶ÔÏó¡£
public:
static A *pt;
static A *instance()
{
if (pt == NULL)//×¢ÒâÊÇË«µÈºÅ£¬»¹ÓкÃÏñÔÚC++ÖÐÓÃnull ²»ºÃʹ¡£
{
pt=new A;
return pt;
}
else
return pt;
}
~A()
{
delete pt;//ÒòΪ¿ª±ÙÁ˶ѿռ䣬ҪÓÃdelete ÊÍ·Å¡£
}
void id_set(int x)
{
id=x;
}
void id_get()
{
printf("%d",id);
}
};
A* A::pt=NULL;//¾²Ì¬³ÉÔ±±äÁ¿Ö»ÄÜÔÚÀàÍâ³õʼ»¯¡£
int main()
{
//´ËÀ಻ÄÜÔÚÕ»ÉÏ·ÖÅä¶ÔÏóÖ»ÄÜͨ¹ýÀàÖÐÌṩµÄº¯Êý½Ó¿ÚÓÃnewÔÚ¶ÑÉÏ·ÖÅä¶ÔÏó¡£
A *ppt=A::instance();
ppt->id_set(10);
ppt->id_get();
A *ppt1=A::instance();
ppt1->id_get();
ppt1->id_set(5);
ppt->id_get();
return 0;//ÔÚº¯Êý½áÊøÊ±×Ô¶¯µ÷ÓÃÎö¹¹º¯Êý~A£¨£©£»
}
Êä³öÊÇ10105
¿ÉÒÔ¿´³öpptÓëppt1Ö¸ÏòµÄÊÇͬһ¸ö¶ÔÏó¡£
Ïà¹ØÎĵµ£º
C°æ±¾£º
vim stash.h
#ifndef STASH_H
#define STASH_H
typedef struct STASHTag {
int size; /* Size of each space */
int quantity; /* Number of storage spaces */
int next; /* Next empty space */
/* Dynamically allocated array of bytes: */
unsigned char* ......
ºÜÓвο¼ÒâÒåµÄѧÀúÁ÷³Ì¡£
¡¡¡¡1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC.
¡¡¡¡´ó¶àÊýʱºò£¬ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ£¬²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò£¬¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓÐÓõijÌÐòÔ±£¬×öÒ»¸ö׬ǮµÄ³ÌÐòÔ±¡£ÎÒÃǵļÛÖµ£¬½«ÌåÏÖÔÚ¿Í»§¼ÛÖµÉÏ£¬¶ø²»ÊÇÓïÑÔдµÃºÃ²»ºÃ¿´¡£
¡¡¡¡C++ÊÇCµÄÒ»¸öÃæÏò¶ÔÏóµÄ½âÊÍ£¬C++ΪCÀ ......
W3C±ê×¼µÄHTML±êÇ©
°´¹¦ÄÜÀà±ðÅÅÁÐ
DTD£ºÖ¸Ê¾ÔÚÄÄÖÖ XHTML 1.0 DTD ÖÐÔÊÐí¸Ã±êÇ©¡£
S=Strict,ÑϸñÀàÐÍ, T=Transitional,¹ý¶ÉÀàÐÍ¡¾×îÆÕ±é¡¿, F=Frameset,¿ò¼ÜÀàÐÍ.
±êÇ©³É¶Ô£¬xhtmlÊDZÈhtml¸üÑϸñ£¬ÀàËÆXML¸ñʽ
±êÇ©ÃèÊöDTD
<!DOCTYPE>
¶¨ÒåÎĵµÀàÐÍ¡£
STF
<html>
¶¨Òå HTML Îĵµ¡£
STF
< ......
±ÈÈç ÊäÈë1.9»áÏÔʾ1.899999 ÀàËÆµÄÎÊÌâ
ÓÉÓÚCÓïÑÔÖжÔÓÚ¸¡µãСÊýµÄ±í´ï·½Ê½µÄ¾ÖÏÞµ¼Öµġ£CÓïÑÔÖÐ10½øÖÆÐ¡ÊýÊÇÖ±½ÓÓÃ2½øÖÆÐ¡ÊýÀ´±íʾµÄ¡£ÓÉÓÚijЩ10½øÖÆÐ¡Êý¸ù±¾ÎÞ·¨ÓÃ2½øÖÆÐ¡ÊýÀ´¾«È·±í´ï£¬Æ©Èç0.1,µ¼Ö¼ÆËã»ú²»µÃ²»ÓýüËÆµÄÏà²îºÜСµÄ2½øÖÆÐ¡ÊýÀ´±íʾÕâЩ10½øÖÆÐ¡Êý¡£
¼ÈÈ»ÊǽüËÆ£¬¾ÍÒ» ......