锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩激情小视频,亚洲国产精品成人va在线观看,一区二区三区国产精品http://www.shnenglu.com/rednight/archive/2007/12/10/38178.htmlrednightrednightMon, 10 Dec 2007 08:12:00 GMThttp://www.shnenglu.com/rednight/archive/2007/12/10/38178.htmlhttp://www.shnenglu.com/rednight/comments/38178.htmlhttp://www.shnenglu.com/rednight/archive/2007/12/10/38178.html#Feedback0http://www.shnenglu.com/rednight/comments/commentRss/38178.htmlhttp://www.shnenglu.com/rednight/services/trackbacks/38178.html鍏抽敭璇嶏細safety, extensibility

int i;
Rational r;                           
// r is a rational number

cin 
>> i >> r;
cout 
<< i << r;


class Rational {
public:
  Rational(
int numerator = 0int denominator = 1);
  
private:
  
int n, d;    // numerator and denominator
friend ostream& operator<<(ostream& s, const Rational& r);
};
ostream
& operator<<(ostream& s, const Rational& r)
{
  s 
<< r.n << '/' << r.d;
  
return s;
}

緇曞紑scanf(),printf()鎭間漢鐨勬牸寮忚姹傘備嬌鐢ㄤ究鎹鳳紝瀹夊叏鐨?lt;<,>>鎿嶄綔絎︺?/span>

鏈鍚庯紝
#include<iostream.h>鏄叏灞鎰忎箟涓婄殑搴撳嚱鏁板0鏄庯紝瀹規槗鍐茬獊銆?/span>
#include<iostream>鏄疭TL鐨勫啓娉曪紝瑕佸悕瀛楃┖闂磗td::澹版槑銆?/span>




rednight 2007-12-10 16:12 鍙戣〃璇勮
]]>
銆奺ffective c++ II銆嬪涔犵瑪璁?Item1 Prefer const and inline to #definehttp://www.shnenglu.com/rednight/archive/2007/12/10/38167.htmlrednightrednightMon, 10 Dec 2007 06:36:00 GMThttp://www.shnenglu.com/rednight/archive/2007/12/10/38167.htmlhttp://www.shnenglu.com/rednight/comments/38167.htmlhttp://www.shnenglu.com/rednight/archive/2007/12/10/38167.html#Feedback0http://www.shnenglu.com/rednight/comments/commentRss/38167.htmlhttp://www.shnenglu.com/rednight/services/trackbacks/38167.html
#define ASPECT_RATIO 1.653

涓昏鏄畯鍦ㄩ緙栬瘧鐨勬椂鍊欒縐婚櫎錛屼笉鍔犲叆緙栬瘧鍣ㄧ紪璇戯紝涓嶅埄浜庨敊璇殑媯嫻嬶紝緇欒皟璇曠淮鎶ゅ甫鏉ヤ竴瀹氬洶闅俱?br>鍥犺岀敤
const double ASPECT_RATIO = 1.653;

浠f浛銆?br>瀛樺湪2涓皬闂闇瑕佹敞鎰?
1)    鎸囬拡甯擱噺闂
const char * const authorName = "Scott Meyers";

闇瑕?嬈′嬌鐢?#8221;const”
2)    鍦ㄧ被鐨勫畾涔変腑
class GamePlayer {
private:
  
static const int NUM_TURNS = 5;    // constant declaration
  int scores[NUM_TURNS];             // use of constant
  
};

姝ゅ錛岃繕蹇呴』鍦?cpp鏂囦歡涓簣浠ュ畾涔?
const int GamePlayer::NUM_TURNS;      // mandatory definition;
                                      
// goes in class impl. file


鍊煎緱娉ㄦ剰鐨勬槸鑰佺殑緙栬瘧鍣ㄤ笉鏀寔榪欑琛ㄨ揪鏂瑰紡錛屽洜姝よ閲囩敤濡備笅鐨勬柟寮忥細
 
class EngineeringConstants {      // this goes in the class
private:                          // header file
  static const double FUDGE_FACTOR;
  
};

// this goes in the class implementation file
const double EngineeringConstants::FUDGE_FACTOR = 1.35;


榪欑鎯呭艦涓嬪鏋滆鍦ㄧ被涓畾涔夊父閲忔暟緇勶紝闇瑕侀噰鐢ㄦ灇涓劇被鍨嬪仛涓鎶樹腑澶勭悊錛?br>
class GamePlayer {
private:
  
enum { NUM_TURNS = 5 };    // "the enum hack" 鈥?nbsp;makes
                             
// NUM_TURNS a symbolic name
                             
// for 5
  int scores[NUM_TURNS];     // fine

};


閬垮厤
#define max(a,b) ((a) > (b) ? (a) : (b))

榪欑鍐欐硶銆?br>閲囩敤鍐呰繛鍑芥暟錛?br>
inline int max(int a, int b) { return a > b ? a : b; }

澧炲己閫傚簲鎬э紝搴旈噰鐢ㄦā鏉跨被錛?br>
template<class T>
inline 
const T& max(const T& a, const T& b)
return a > b ? a : b; }

鎬葷粨錛氬茍涓嶆槸璇翠笉浣跨敤瀹忥紝瑕佹槑紜湴鐭ラ亾浣跨敤瀹忓悗鍙兘浼氬紩璧風殑鍚庢灉錛屽噺灝戞湁姝т箟鐨勬儏鍐靛彂鐢熴?br> 


rednight 2007-12-10 14:36 鍙戣〃璇勮
]]>
銆奺ffective c++ II銆婭ntroductionhttp://www.shnenglu.com/rednight/archive/2007/12/06/37914.htmlrednightrednightThu, 06 Dec 2007 09:08:00 GMThttp://www.shnenglu.com/rednight/archive/2007/12/06/37914.htmlhttp://www.shnenglu.com/rednight/comments/37914.htmlhttp://www.shnenglu.com/rednight/archive/2007/12/06/37914.html#Feedback0http://www.shnenglu.com/rednight/comments/commentRss/37914.htmlhttp://www.shnenglu.com/rednight/services/trackbacks/37914.htmlhttp://www.shnenglu.com/rednight/articles/37913.html
涓哄暐鍙湁闅忕瑪鑳芥樉紺哄湪涓婚〉闈笂鍛紵

rednight 2007-12-06 17:08 鍙戣〃璇勮
]]>
久久精品国产亚洲av日韩| 国产精品亚洲美女久久久| 2021久久国自产拍精品| 狠狠色婷婷综合天天久久丁香 | 亚洲精品乱码久久久久久自慰| 久久精品中文字幕大胸| 中文字幕亚洲综合久久| 2021国内精品久久久久久影院| 国产精品99久久精品| 欧美精品国产综合久久| 国产精品成人99久久久久91gav| 天堂久久天堂AV色综合| 欧美性猛交xxxx免费看久久久| 精品国产乱码久久久久久1区2区 | 亚洲va中文字幕无码久久不卡 | 久久精品人妻中文系列| 99热都是精品久久久久久| 久久久亚洲欧洲日产国码aⅴ| 污污内射久久一区二区欧美日韩| 9191精品国产免费久久| 好久久免费视频高清| 久久综合给久久狠狠97色| 97视频久久久| 久久久国产视频| 国产精品久久婷婷六月丁香| 久久久久亚洲精品无码网址| 亚洲精品高清国产一久久| 91精品国产9l久久久久| 久久se精品一区二区| 精品熟女少妇av免费久久| 久久久久久亚洲AV无码专区| 亚洲午夜久久久影院| 久久久久亚洲av无码专区导航| 狠狠综合久久综合88亚洲| 天堂久久天堂AV色综合| 国产精品久久国产精品99盘| 99久久精品国产高清一区二区 | 久久免费视频1| 伊人久久综合无码成人网| 久久综合噜噜激激的五月天| 久久国产乱子伦精品免费强|