c/c++ ¾²Ì¬±äÁ¿ Ò»¸öʵÀý
#include <iostream>
#include <cstdlib>
using namespace std;
class Foo
{
public:
Foo(int ii):i(ii){}
int getInt(){return i;}
private:
int i;
};
class Bar
{
public:
static int FooVal(){c++; return f.getInt();}
int callsFooVal(){return c;}
private:
static int c;
static Foo f;
};
int Bar::c=0;
Foo Bar::f(9);
int main()
{
Bar b;
cout<<Bar::FooVal()<<endl;
cout<<b.callsFooVal()<<endl;
cout<<Bar::FooVal()<<endl;
cout<<b.callsFooVal()<<endl;
cout<<Bar::FooVal()<<endl;
cout<<b.callsFooVal()<<endl;
system("PAUSE");
return 0;
}
Ïà¹ØÎĵµ£º
1. cÓïÑÔÖеÄÕûÊýÀàÐÍÓÐchar, short, int, longµÈ¼¸ÖÖ, ÏÂÃæÊÇCÓïÑÔ¶ÔÿÖÖÊý¾ÝÀàÐͳ¤¶ÈµÄ¹æ¶¨:
(a). shortºÍlongÀàÐ͵ij¤¶È²»Ïàͬ
(b). intÀàÐÍͨ³£Í¬¾ßÌå»úÆ÷µÄÎïÀí×Ö³¤Ïàͬ
(c). shortͨ³£ÊÇ16bits, intͨ³£ÊÇ16bits or 32bitsÿÖÖ±àÒëÆ÷¿ÉÒÔ¸ù¾ÝÓ²¼þµÄ²»Í¬×ÔÓÉÈ·¶¨, µ«ÊÇshortºÍint±ØÐë×îÉÙÊÇ16bits, ¶ølongÀàÐͱØÐë× ......
ÌâÄ¿£º±àдһ¸ö³ÌÐò£¬ÓÃÓÚ´¦Àíc/c++Ô´³ÌÐò£¬½«Ô´³ÌÐòÖеÄ×¢ÊͲ¿·ÖÈ¥µô
ÊäÈ룺c/c++ÎļþÃû
Êä³ö£º´¦ÀíºóµÄ³ÌÐòÔ´Îļþ
³ÌÐòα´úÂëÈçÏ£º
c1,c2:char
tag:int
a:¶ÁÈëÒ»¸ö×Ö·û´æÈëc1
if tag==0 //¶ÁÈë×Ö·û²»ÊÇ×¢ÊÍ
if c1=='/' //¿ÉÄÜÊÇ×¢Êͱê¼Ç
¶ÁÈëÒ»¸ö×Ö·û´æÈëc2
&nbs ......
ÖÜÎ忪»á×öÍŶӳÉÔ±codereivew£¬ ÓÐͬÊÂÌá³öÁËÒ»¸ö¹ØÓÚgmtime¶àÏß³ÌÊÇ·ñ°²È«µÄÎÊÌ⣬ µ±Ê±¾õµÃ³ÌÐòLinkÁËVCµÄ¶àÏ߳̿⣬Ӧ¸Ã²»ÊÇÎÊÌâ¡£»¹ºÃ»ØÍ·ºËʵÁËһϣ¬·¢ÏÖÁ˾¹ÊÇÒ»¸öDZÔÚµÄbug¡£
³ÌÐò·ÖÔÚapplication£¨Íê³ÉÏîÄ¿Ìض¨¹¦ÄÜ£©ºÍframework£¨¿ÉÖØÓõĺËÐŦÄÜ£©Á½²¿·Ö£¬Ï̵߳ÄÆô¶¯ÓÉframeworkÍê³É¡£ appÖÐʹÓÃÁËgmtime/loc ......
ÌýÆðÀ´£¬ÓÐ×ÔÐÅ£¬ÓиãЦ¡£ÓÖ×ÔÐÅ£¬ÓÖ¸ãЦ¡£
Á½ÄêÇ°£¬¿¼ÈëÁËÒ»¸ö¶þÁ÷´óѧ£¬·Ç¼ÆËã»úרҵ¡£µ±³õ»³×ÅÎÞ±ÈÃÀºÃµÄÐÄÇ飬ֻÊÇÏ£ÍûÔÚѧУ¹ýµÄ¿ìÀÖЩ£¬Ñ§µÄºÃЩ£¬µ«ÊÇÓÐЩÊÂÇé×ÜÊÇÄÑÒÔÔ¤ÁÏ£¬ÎÒ×ÜÊÇÎÞ·¨ÍüÈ´ÄÇ·Ý»³ÄÔÚÕâ¸öÄ°ÉúµÄ³ÇÊУ¬ÎÒ×ÜÊÇÃÔʧÁË×Ô¼º¡£Ä¬Ä¬µÄ¶ãÔÚ×Ô¼ºµÄÊÀ½çÀïÌòóÂÉË¿Ú£¬ÔÒÔΪµ½Á˸öеĻ·¾³ÄÜÍüµôÒ»ÇеÄÉËÐÄ¹Ê ......
I2CÊÇPhillips¿ª·¢µÄ2ÏߵĴ®ÐÐ×ÜÏßÐÒ顣ͨ³£Ó¦ÓÃÔÚǶÈëʽϵͳÖÐÈò»Í¬µÄ×é¼þͨÐÅ£¬PCÖ÷°å¿ÉÒÔͨ¹ýI2CÀ´Ó벻ͬµÄ´«¸ÐÆ÷ͨÐÅ¡£ÕâЩ´«¸ÐÆ÷ͨ³£±¨¸æ·çÉÈËٶȣ¬´¦ÀíÆ÷ζȺÍÕû¸öÓ²¼þϵͳµÄÐÅÏ¢£¬Õâ¸öÐÒéÒ²¿ÉÒÔÓÃÔÚRAM chipsÉÏ£¬Ïò²Ù×÷ϵͳÌṩDIMMµÄÐÅÏ¢¡£
ÔÚ2.0ʱI2CµÄkernelÔ´Âë²»ÔÚÄÚºËÀïµÄ£¬2.4Äں˰üÀ¨ÁËÒ»µã¶ÔI2CµÄÖ§³Ö ......