close
Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
struct相關
Jul 25th 2013, 19:01

假設有一struct

struct list_int{
pint *p;
int i;
};

並建立一個list_int
list_int l;
l.p = &l;
l.a = 5;


cout<<b.p->p->p->p->p->p->p->p->p->a;
cout<<b.p->a;
兩指令執行速度一樣嗎?

很多函式都會新增變數
例如
int example(const list_int &l){
const int a = l.i;
....
...
}
為何不直接用l.i
是效率問題
還是閱讀性問題

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 gyyij7s6y6fly 的頭像
    gyyij7s6y6fly

    線上遊戲排行榜2013/2014,進擊的巨人線上看,candy crush saga外掛,正妹寫真三圍

    gyyij7s6y6fly 發表在 痞客邦 留言(0) 人氣()