锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久亚洲AV成人网,久久久久亚洲AV片无码下载蜜桃 ,久久精品国产乱子伦http://www.shnenglu.com/chenglong7997/zh-cnTue, 06 May 2025 21:36:35 GMTTue, 06 May 2025 21:36:35 GMT60internhttp://www.shnenglu.com/chenglong7997/archive/2012/09/02/189077.htmlSnapeSnapeSat, 01 Sep 2012 17:16:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/09/02/189077.htmlhttp://www.shnenglu.com/chenglong7997/comments/189077.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/09/02/189077.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/189077.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/189077.htmlfix step錛?br />鍏坮eproduce
鍐嶇‘瀹氬嚭鐜伴棶棰樼殑鍑芥暟錛岃鍙?br />鍒嗘瀽鍘熷洜
fix 


vs涓繙紼嬭皟璇曪紝鎸囧畾ip錛宲ort錛?鍚屾椂鍦ㄨ繙紼嬩富鏈轟笂瑕佸悓鎰忚繙紼嬭皟璇曪紝鎺ュ彈鎸囧畾user銆傝淇濊瘉code涓巈xe鏂囦歡涓鑷淬?br />璁懼畾鏂偣錛岃瀵焏ebug杈撳叆錛屼笌棰勬兂鐨勬湁浠涔堜笉鍚屻傝瀵焍t錛宼hread stack 鎵懼埌鍑虹幇闂鐨勫嚱鏁版垨鑰呰鍙楓?br />
p4 涓殑check out, commit, diff, opened, edit錛?sync鍛戒護鍜屼綔鐢ㄣ?br />submit step錛歮erge changlist (from branch) (to branch)
check diff
resolve
make (so make sure the code is right)
submit (add comments)
set the bug state in Web

vim:鐔熸倝浜嗗悇縐嶅懡浠ゃ?br />
cscope錛宑tag錛氬湪linux涓祻瑙堜唬鐮佸緢鏈夌敤錛屽彲浠ユ壘鍒癴unction definition, struct definition, calling function, called function. 

鍦ㄤ竴涓洰褰曚腑寤虹珛cscope database錛?鍙互鍐嶄富鐩綍寤虹珛錛屼箣鍚庡彧鍦ㄨ繖閲屼嬌鐢╟scope錛屽氨鑳芥壘鍒板叏閮ㄥ紩鐢ㄣ?br />
linux錛?lib 鏂囦歡鐨勪嬌鐢ㄣ?鏈?a 鍜?o鐨刲ib鏂囦歡銆?br />
2.code style.
鏂囦歡鍛藉悕瑕佹湁灞傛鎰熴備緥濡傦紝snape_webserver_msg.c, snape_webserver_thread.c, snape_webserver_log.c, snape_client_msg.c,,,
鍑芥暟鍛藉悕涔熻鏈夊眰嬈℃劅錛?渚嬪錛宻nape_webserver_msg_set_connection(), snape_webserver_thread_create(),snape_client_request_get_pic().
鍙橀噺鍛藉悕涔熻鏈夊眰嬈℃劅鍜屾剰涔夈?br />鍑洪敊澶勭悊鐨勪笓闂ㄥ嚱鏁般?br />debug level錛歞ebug錛宨nfo, basic, webserver, client,,,

3.鍑芥暟鐨勫畾涔変笌嫻忚銆?br />call graph definition.
鍑芥暟鍚嶅瓧鏈濂借兘澶熸樉紺哄嚭鍑芥暟璋冪敤鐨刧raph銆?br />浣跨敤hash table 淇濆瓨澶ч噺綾誨瀷鐨勬暟鎹?br />浣跨敤鍐呭鐨刴d5浣滀負榪欎釜鍐呭鐨刬d錛屽氨鍙互瀹岀編閰嶅悎hash table銆?br />
4.thread錛?process
windows 涓紝 object , event, cs
cs鍚屾閫熷害杈冨揩錛屼絾鏄嬌鐢╟s瀹規槗榪涘叆deadlock鐘舵併傚洜涓哄湪絳夊緟榪涘叆cs鏃訛紝鏃犳硶璁懼畾瓚呮椂鍊箋?br />浜掓枼瀵硅薄涓庡唴鏍稿璞″睘浜庡唴鏍稿璞★紝鍒╃敤鍐呮牳瀵硅薄榪涜綰跨▼鍚屾錛屽悓姝ラ熷害杈冩參錛屼絾榪欑鏂瑰紡鍙湪澶氫釜榪涚▼鐨勫悇涓璞′箣闂磋繘琛屽悓姝ャ?br />event鍒嗕負浜哄伐閲嶇疆涓庤嚜鍔ㄩ噸緗簨浠訛紝涓よ呭湪緇嗚妭涓婏紝涓嶅悓銆?br />
5.cache implementation
client绔彲浠ヤ嬌鐢ㄧ被浼紀s涓紝cache 涓?铏氭嫙鍐呭瓨鐨勬柟娉曘俠_modified琛ㄧず鏄惁緇忚繃鏇存敼錛屼粠鑰屾槸鍚﹂渶瑕佹洿鏂般傛瘡嬈″彧鍘繪嬁鏂扮殑涓滆タ銆?br />鑰屽湪server绔紝鍙互浣跨敤鍐呭鐨凪D5鍒ゆ柇鏄惁闇瑕佸鐞嗘潵鍒扮殑鍐呭錛屽彲浠ョ敤澶氬眰嬈$殑MD5鏉ユ洿鍔犲幓improve performance銆備緥濡傜敤鎬諱綋鐨刴d5錛屽拰鍚勪釜閮ㄥ垎鐨刴d5.
鍏堝垽鏂諱綋MD5錛屽鏋滄敼鍙橈紝鍦ㄥ幓媯鏌ラ儴鍒唌d5.濡傛灉娌℃湁鏀瑰彉錛屽氨鏁翠釜閮藉彲浠ヤ涪寮冿紝涓嶅幓澶勭悊銆?br />design is very important. 浠g爜鐨勬墽琛岃繃紼嬭瀹屽叏渚濊禆design銆?br />
6.select function
寮傛select錛?鍙互璁╃嚎紼嬩笉鍘籦usy waiting銆?br />浣嗘槸濡傛灉闇瑕佷紶杈撳唴瀹癸紝闇瑕乼rigger signal錛岃瀹冧笉鐢ㄧ瓑鍒皌imeout錛屽氨鑳藉彂閫佹暟鎹?br />
7.timestamp/timeout/ ts_diff
鍙互鐢╰s_diff鍘誨悓姝ユ椂闂淬?br />浣跨敤timeout鏉ラ槻姝換鎰忔搷浣滅殑鏃犻檺鍒剁瓑寰?br />浣跨敤timestamp鏉ュ喅瀹氬摢涓涓洿鏂般備笉瑕佺敤counter銆傦紙鏃犳硶鍚屾錛屾棤娉曟帶鍒跺崟涓鎬э級

8.xml api
鍦ㄤ紶閫佹暟鎹柟闈紝鍙互浣跨敤xml

9.performace/memory usage
mm tools.
































Snape 2012-09-02 01:16 鍙戣〃璇勮
]]>
Signed to unsigned conversion in C - is it always safe? (from stackoverflow)http://www.shnenglu.com/chenglong7997/archive/2012/08/17/187437.htmlSnapeSnapeThu, 16 Aug 2012 18:32:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/08/17/187437.htmlhttp://www.shnenglu.com/chenglong7997/comments/187437.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/08/17/187437.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/187437.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/187437.htmlSuppose I have the following C code.

unsigned int u = 1234;
int i = -5678;

unsigned int result = u + i;

What implicit conversions are going on here, and is this code safe for all values of u and i? (Safe, in the sense that even though result in this example will overflow to some huge positive number, I could cast it back to an int and get the real result.)

Answer:

Short Answer

Your i will be converted to an unsigned integer by adding UINT_MAX + 1, then the addition will be carried out with the unsigned values, resulting in a large result (depending on the values of u andi).

Long Answer

According to the C99 Standard:

6.3.1.8 Usual arithmetic conversions

  1. If both operands have the same type, then no further conversion is needed.
  2. Otherwise, if both operands have signed integer types or both have unsigned integer types, the operand with the type of lesser integer conversion rank is converted to the type of the operand with greater rank.
  3. Otherwise, if the operand that has unsigned integer type has rank greater or equal to the rank of the type of the other operand, then the operand with signed integer type is converted to the type of the operand with unsigned integer type.
  4. Otherwise, if the type of the operand with signed integer type can represent all of the values of the type of the operand with unsigned integer type, then the operand with unsigned integer type is converted to the type of the operand with signed integer type.
  5. Otherwise, both operands are converted to the unsigned integer type corresponding to the type of the operand with signed integer type.

In your case, we have one unsigned int (u) and signed int (i). Referring to (3) above, since both operands have the same rank, your i will need to be converted to an unsigned integer.

6.3.1.3 Signed and unsigned integers

  1. When a value with integer type is converted to another integer type other than _Bool, if the value can be represented by the new type, it is unchanged.
  2. Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or subtracting one more than the maximum value that can be represented in the new type until the value is in the range of the new type.
  3. Otherwise, the new type is signed and the value cannot be represented in it; either the result is implementation-defined or an implementation-defined signal is raised.

Now we need to refer to (2) above. Your i will be converted to an unsigned value by adding UINT_MAX + 1. So the result will depend on how UINT_MAX is defined on your implementation. It will be large, but it will not overflow, because:

6.2.5 (9)

A computation involving unsigned operands can never overflow, because a result that cannot be represented by the resulting unsigned integer type is reduced modulo the number that is one greater than the largest value that can be represented by the resulting type.

Bonus: Arithmetic Conversion Semi-WTF

#include <stdio.h>

int main(void)
{
 
unsigned int plus_one = 1;
 
int minus_one = -1;

 
if(plus_one < minus_one)
    printf
("1 < -1");
 
else
    printf
("boring");

 
return 0;
}

You can use this link to try this online: http://codepad.org/yPhYCMFO

Bonus: Arithmetic Conversion Side Effect

Arithmetic conversion rules can be used to get the value of UINT_MAX by initializing an unsigned value to -1, ie:

unsigned int umax = -1; // umax set to UINT_MAX

This is guaranteed to be portable regardless of the signed number representation of the system because of the conversion rules described above. See this SO question for more information: Is it safe to use -1 to set all bits to true?



Snape 2012-08-17 02:32 鍙戣〃璇勮
]]>
chapter 7(鍙Щ妞嶆х己闄?http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180117.htmlSnapeSnapeSun, 24 Jun 2012 23:10:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180117.htmlhttp://www.shnenglu.com/chenglong7997/comments/180117.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180117.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180117.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180117.html
ANSI C鏍囧噯鍙繚璇佷簡C瀹炵幇蹇呴』鑳藉鍖哄埆鍑哄墠6涓瓧絎︿笉鍚岀殑澶栭儴鍚嶇О銆傝屼笖榪欎釜瀹氫箟涓茍娌℃湁鍖哄垎澶у啓瀛楁瘝涓庡叾瀵瑰簲鐨勫皬鍐欏瓧姣嶃?/span>
鍥犳錛岀紪鍐欏彲縐繪紼嬪簭蹇呴』灝忓績榪欎竴鐐廣?br />
2.瀛楃鏄湁絎﹀彿鐨勬暣鏁幫紝榪樻槸鏃犵鍙風殑鏁存暟
鍙湁鎶婁竴涓瓧絎﹀艱漿鎹?span style="color: red; ">涓轟竴涓緝澶х殑鏁存暟
鏃訛紝鎵嶉噸瑕併傚湪鍏朵粬鎯呭喌涓嬶紝緇撴灉閮芥槸錛氬浣欑殑浣嶈綆鍗曠殑“涓㈠純”銆?br />
鍦ㄨ漿鎹㈣繃紼嬩腑錛氬簲璇ュ皢瀛楃浣滀負鏈夌鍙鋒暟榪樻槸鏃犵鍙鋒暟錛?br />濡傛灉鏈夌鍙鳳紝緙栬瘧鍣ㄥ皢char鏁版嵁錛屾墿灞曞埌int鏃跺欙紝搴旇澶嶅埗絎﹀彿浣嶃?br />濡傛灉鏃犵鍙鳳紝緙栬瘧鍣ㄥ彧闇鍦ㄥ浣欑殑浣嶄笂濉厖0.
#include <stdio.h>

int main()
{
    char c='a';
    c=c+40;
//    printf("%c\n", -1); 
    printf("c %d\n", c);
    printf("unsigned c %u\n", (unsigned char)c);
}
緇撴灉錛?br />
c -119
unsigned c 137
璇存槑鍦╣cc涓紝灝哻har褰撳仛鏈夌鍙鋒暟銆傚湪c+40鐨勬椂鍊欙紝瓚呰繃浜?128~127鑼冨洿錛屽洜姝ゆ孩鍑恒傚鏋滄槸鏃犵鍙穋har錛岃寖鍥存槸0~255.搴旇鏄緭鍑?37.

濡傛灉緙栫▼鑰呭叧娉ㄤ竴涓渶楂樹綅鏄?鐨勫瓧絎︽槸姝h繕鏄礋錛屽彲浠ヨ緗?span style="color: red; ">涓烘棤絎﹀彿瀛楃鏁?/span>銆傝繖鏍鋒墍鏈夌紪璇戝櫒閮戒細杞崲涓烘暣鏁版椂鍊欙紝濉厖涓?.


3.涓涓父瑙侀敊璇槸錛氬鏋渃鏄竴涓瓧絎﹀彉閲忥紝浣跨敤錛坲nsigned錛塩鍙互寰楀埌涓巆絳変環鐨勬棤絎﹀彿鏁存暟銆?span style="color: red; ">榪欐槸浼氬け璐ョ殑銆傚洜涓哄湪灝哻杞崲涓烘棤絎﹀彿鏁存暟鏃跺欙紝c灝嗛鍏堥鍏堣杞崲涓篿nt鍨嬫暣鏁般傝屾鏃跺彲鑳藉緱鍒伴潪棰勬湡鐨勭粨鏋溿?br />姝g‘鏂規硶鏄?/span>錛?unsigned char )c錛岀洿鎺ヨ繘琛岃漿鎹€?br />
渚嬪涓婁釜渚嬪瓙涓紝鏈鍚庝竴鍙ユ敼涓?
printf("unsigned c %u\n", (unsigned )c);

閭d箞緇撴灉鏄?
c -119
unsigned c 4294967177
c琚厛杞崲涓篿nt鍨?119錛屽啀姹備粬鐨勬棤絎﹀彿琛ㄨ揪褰㈠紡錛?span style="font-size: 13px; background-color: #eeeeee; ">4294967177
 

4.縐諱綅榪愮畻絎?br />   1.鍚戝彸縐諱綅鏃訛紝絀哄嚭鐨勪綅鐢?濉厖錛岃繕鏄敱絎﹀彿浣嶇殑鍓湰濉厖銆?br />   2.濡傛灉鏄棤絎﹀彿鏁幫紝鐢?濉厖銆傚鏋滄槸鏈夌鍙鋒暟錛屾棦鍙互鐢?涔熷彲浠ョ敤絎﹀彿浣嶇殑鍓湰銆傦紙濡傛灉鍏蟲敞鍙崇Щ鏃跺欑┖鍑虹殑浣嶏紝鍙互澹版槑涓烘棤絎﹀彿綾誨瀷錛岄偅涔堢┖鍑虹殑浣嶉兘浼氳璁劇疆涓?錛?br />
   濡傛灉琚Щ浣嶅璞′負n浣嶏紝閭d箞縐諱綅璁℃暟蹇呴』澶т簬鎴栫瓑浜?錛岃屼弗鏍煎皬浜巒.
鍗充嬌C瀹炵幇灝嗙鍙蜂綅澶嶅埗鍒扮┖鍑虹殑浣嶄腑錛屾湁絎﹀彿鏁扮殑鍚戝彸縐諱綅錛?span style="color: red; ">涔熷茍涓嶇瓑浜庨櫎浠?鐨勬煇嬈″箓銆備緥濡傦紙-1錛?gt;>1緇撴灉涓?1錛岃屼笉鏄?1/2 == 0

5.闅忔満鏁版渶澶у鹼紝RAND_MAX鍦╨imits涓畾涔夈傛垜嫻嬭瘯緇撴灉絳変簬INT_MAX

6.闄ゆ硶榪愮畻鐨勬埅鏂?br />q=a/b;
r=a%b;
鍋囧畾b>0.
C璇█瀹氫箟鍙繚璇乹*b+r=a,浠ュ強a>=0 涓?b>0鏃訛紝淇濊瘉|r|<|b|浠ュ強r>=0.
錛堝鏋渁<0, 閭d箞r涔熷彲鑳藉皬浜?錛?/span>
渚嬪錛?br />
int main() {
    // Start typing your code here
    
    cout<<(-3)/2<<endl;
    return 0;
}
緇撴灉鍟嗕負-1錛屼綑鏁頒篃涓?1


Snape 2012-06-25 07:10 鍙戣〃璇勮
]]>
chapter 6錛堥澶勭悊鍣級http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180104.htmlSnapeSnapeSun, 24 Jun 2012 18:26:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180104.htmlhttp://www.shnenglu.com/chenglong7997/comments/180104.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180104.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180104.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180104.html錛?涓嬈′慨鏀瑰彉閲忥紝鍑虹幇鐨勬墍鏈夌殑鍊奸兘浼氫慨鏀廣?br />璁叉墍鏈夊父閲忓畾涔夐泦涓湪涓璧楓?br />
錛?閬垮厤鍑芥暟璋冪敤寮閿銆?br />
3.瀹忓畾涔夋敞鎰忕偣
    1.涓嶈兘蹇借瀹氫箟涓殑絀烘牸
    2.鏈濂藉皢瀹忓畾涔変腑姣忎釜鍙傛暟閮界敤鎷彿鎷搗鏉ャ傛暣涓〃杈懼紡鐨勭粨鏋滈〉鐢ㄦ嫭鍙鋒嫭璧鋒潵銆?br />    3.紜繚璋冪敤瀹忕殑鍙傛暟涓紝涓嶅瓨鍦ㄦ湁鍓綔鐢ㄧ殑浠g爜

4.assert瀹忋傚彲浠ュ湪鍑洪敊淇℃伅涓寘鍚枃浠跺悕鍜屾柇璦澶辮觸澶勭殑琛屽彿銆傚緢鏈夌敤銆?br />
5.瀹忓茍涓嶆槸綾誨瀷瀹氫箟銆?br />#define T1 struct foo *
typedef struct foo * T2;
T1 a,b; //struct foo * a, b;
T2 a,b; //a ,b閮芥槸鎸囧悜緇撴瀯鐨勬寚閽堛?img src ="http://www.shnenglu.com/chenglong7997/aggbug/180104.html" width = "1" height = "1" />

Snape 2012-06-25 02:26 鍙戣〃璇勮
]]>
chapter 5http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180103.htmlSnapeSnapeSun, 24 Jun 2012 18:10:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180103.htmlhttp://www.shnenglu.com/chenglong7997/comments/180103.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180103.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180103.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180103.html
getchar榪斿洖鏁村艦

#include <stdio.h>

int main()
{
    char c;
    while( (c=getchar())!=EOF )
        putchar(c);
}

搴旇灝哻澹版槑涓篿nt銆傚惁鍒欙紝c鍙兘鏃犳硶瀹逛笅EOF

2.鏇存柊鏂囦歡
璇繪搷浣滀箣鍚庯紝鏂囦歡鎸囬拡浼氬亸縐諱竴孌點傝繖鏃跺欙紝璁叉枃浠舵洿鏂板悗錛屽啓鍏ユ簮鏂囦歡涔嬪墠錛屽簲璇seek璁叉枃浠舵寚閽堣皟鍥炲幓銆?br />
3.浣跨敤setbuf璁劇疆杈撳嚭鐨勭紦鍐插尯澶у皬銆傚彲浠ユ槸stdout鍜宖ile

4.姝g‘浣跨敤errno媯嫻嬮敊璇?br />errno=0;
/*璋冪敤搴撳嚱鏁?/
if(榪斿洖鐨勯敊璇?   //榪欎釜閿欒鍊煎彲鑳戒笉鏄敱褰撳墠榪欎釜鍑芥暟寮曡搗鐨勩傝屾槸鐢卞綋鍓嶅嚱鏁幫紝鍙堣皟鐢ㄧ殑鍙﹀涓涓嚱鏁板紩璧風殑銆?br />   媯鏌rrno;

5.signal澶勭悊鍑芥暟鍞竴瀹夊叏錛屽彲縐繪鐨勬搷浣滃氨鏄墦鍗頒竴鏉¢敊璇俊鎭紝鐒跺悗浣跨敤longjmp鎴栬卐xit绔嬪嵆閫鍑虹▼搴忋?br />

Snape 2012-06-25 02:10 鍙戣〃璇勮
]]>
chapter 4http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180101.htmlSnapeSnapeSun, 24 Jun 2012 17:41:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180101.htmlhttp://www.shnenglu.com/chenglong7997/comments/180101.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180101.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180101.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180101.html
2.extern int n;
鍦ㄤ袱澶栦竴涓枃浠朵腑錛?long n錛?br />榪欐槸涓涓棤鏁堢殑紼嬪簭錛屽洜涓哄悓涓涓閮ㄥ彉閲忓悕鍦ㄤ袱涓笉鍚岀殑鏂囦歡涓澹版槑涓轟笉鍚岀殑綾誨瀷銆傜劧鍚庡ぇ澶氭暟c璇█瀹炵幇涓嶈兘媯嫻嬪嚭榪欑閿欒銆?br />
3.涓涓▼搴忕敱澶氫釜妯″潡緇勬垚錛屾瘡涓ā鍧楅兘闇瑕佺煡閬撲竴涓壒瀹氱殑鏂囦歡鍚嶃傛垜浠笇鏈涜兘澶熷仛鍒板彧鍦ㄤ竴澶勬敼鍔ㄨ繖涓枃浠跺悕錛屾墍鏈夋ā鍧椾腑鐨勬枃浠跺悕灝辮兘鍚屾椂寰楀埌鏇存柊銆?br />鍙互錛屽厛鍒涘緩涓涓枃浠訛紝鍙仛file.h錛屽畠鍖呭惈浜嗗0鏄?span style="color: red; ">extern char filename[];
闇瑕佺敤鍒板閮ㄥ璞ilename鐨勬瘡涓猚婧愭枃浠墮兘搴旇鍔犱笂錛?#include "file.h"錛?br />鏈鍚庨夋嫨涓涓狢婧愭枃浠訛紝鍦ㄥ叾涓粰鍑篺ilename鐨勫垵濮嬪箋傚鍦╢ile.c涓?br />#include "file.h";
char filename[]="/etc/passwd";

榪欐牱灝變繚璇佷簡filename鐨勭被鍨嬫槸姝g‘鐨勩傝В鍐充簡2涓殑闂銆?img src ="http://www.shnenglu.com/chenglong7997/aggbug/180101.html" width = "1" height = "1" />

Snape 2012-06-25 01:41 鍙戣〃璇勮
]]>
鏁存暟婧㈠嚭http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180099.htmlSnapeSnapeSun, 24 Jun 2012 17:15:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180099.htmlhttp://www.shnenglu.com/chenglong7997/comments/180099.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180099.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180099.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180099.html 鏁存暟婧㈠嚭
c璇█涓瓨鍦ㄤ袱綾繪暣鏁扮畻鏈繍綆楋紝鏈夌鍙瘋繍綆楀拰鏃犵鍙瘋繍綆椼?span style="color: #ff00ff; ">鍦ㄦ棤絎﹀彿榪愮畻閲岋紝娌℃湁浜嗙鍙蜂綅錛屾墍浠ユ槸娌℃湁婧㈠嚭鐨勬蹇電殑銆?/p>

鎵鏈夌殑鏃犵鍙?span style="color: red; ">榪愮畻閮芥槸浠?鐨刵嬈℃柟涓烘ā銆傚鏋滅畻鏈繍綆楃鐨勪竴涓搷浣滄暟鏄湁絎﹀彿涔︼紝鍙︿竴涓槸鏃犵鍙鋒暟錛岄偅涔堟湁絎﹀彿鏁?/p>

浼氳杞崲涓烘棤絎﹀彿鏁?/span>(琛ㄧず鑼冨洿灝忕殑鎬繪槸琚漿鎹負琛ㄧず鑼冨洿澶х殑)錛岄偅涔堟孩鍑轟篃涓嶄細鍙戠敓銆備絾鏄紝褰撲袱涓搷浣滄暟閮芥槸鏈夌鍙鋒暟

鏃訛紝婧㈠嚭灝辨湁鍙兘鍙戠敓銆傝屼笖婧㈠嚭鐨勭粨鏋滄槸鏈畾涔夌殑銆?span style="color: red; ">褰撲竴涓繍綆楃殑緇撴灉鍙戠敓婧㈠嚭鏃訛紝浠諱綍鍋囪閮芥槸涓嶅畨鍏ㄧ殑銆?/span>

渚嬪錛屽亣瀹歛鍜宐鏄袱涓潪璐熺殑鏁村瀷鍙橀噺(鏈夌鍙?錛屾垜浠渶瑕佹鏌+b鏄惁婧㈠嚭錛屼竴縐嶆兂褰撶劧鐨勬柟寮忔槸:

if (a + b < 0)

      婧㈠嚭錛?/p>

瀹為檯涓婏紝鍦ㄧ幇瀹炰笘鐣岄噷錛岃繖騫朵笉鑳芥甯歌繍琛屻傚綋a+b紜疄鍙戠敓婧㈠嚭鏃訛紝鎵鏈夊叧浜庣粨鏋滃浣曠殑鍋囪鍧囦笉鍙潬銆傛瘮濡傦紝鍦ㄦ煇浜?/p>

鏈哄櫒鐨刢pu錛屽姞娉曡繍綆楀皢璁劇疆涓涓唴閮ㄥ瘎瀛樺櫒涓哄洓縐嶇姸鎬?姝o紝璐燂紝闆跺拰婧㈠嚭銆傚湪榪欑鏈哄櫒涓婏紝c緙栬瘧鍣ㄥ畬鍏ㄦ湁鐞嗙敱瀹炵幇浠ヤ笂

鐨勪緥瀛愶紝浣垮緱a+b榪斿洖鐨勪笉鏄礋錛岃屾槸榪欎釜鍐呭瓨瀵勫瓨鍣ㄧ殑婧㈠嚭鐘舵併傛樉鐒訛紝if鐨勫垽鏂細澶辮觸銆?/p>

涓縐嶆紜殑鏂瑰紡鏄皢a鍜宐閮藉己鍒惰漿鎹負鏃犵鍙鋒暣鏁幫細

if ( (unsigned)a + (unsigned)b  > INT_MAX)

      婧㈠嚭;

榪欓噷鐨刬nt_max鍊間負鏈夌鍙鋒暣鍨嬬殑鏈澶у箋傚湪涓鑸殑緙栬瘧鍣ㄩ噷鏄竴涓瀹氫箟鐨勫父閲忋侫NSI C鍦╨imits閲屽畾涔変簡INT_MAX錛屽間負

2鐨?1嬈℃柟-1.

涓嶉渶瑕佺敤鍒版棤絎﹀彿綆楁暟榪愮畻鐨勫彟涓縐嶅彲琛屾柟娉曟槸錛?/p>

if (a > INT_MAX - b )

     婧㈠嚭錛?nbsp;



Snape 2012-06-25 01:15 鍙戣〃璇勮
]]>
鍏充簬鍒ゆ柇鏃犵鍙鋒暣鏁版兂鍔犳孩鍑猴紙杞棽浜鴻崏鍫傦級http://www.shnenglu.com/chenglong7997/archive/2012/06/25/180098.htmlSnapeSnapeSun, 24 Jun 2012 17:11:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180098.htmlhttp://www.shnenglu.com/chenglong7997/comments/180098.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/25/180098.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180098.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180098.html

Snape 2012-06-25 01:11 鍙戣〃璇勮
]]>
chapter 3(璇箟闄烽槺)http://www.shnenglu.com/chenglong7997/archive/2012/06/24/180081.htmlSnapeSnapeSun, 24 Jun 2012 15:53:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/24/180081.htmlhttp://www.shnenglu.com/chenglong7997/comments/180081.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/24/180081.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/180081.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/180081.htmlsizeof()鐨勫弬鏁拌繖涓鎯呭喌錛屽湪鍏朵粬鎵鏈夌殑鎯呭艦涓紝鏁扮粍鍚峚閮戒唬琛ㄦ寚鍚戞暟緇?span style="color: red; ">a涓笅鏍囦負0鐨勫厓绱犵殑鎸囬拡銆?/span>
鍥犳錛宨nt *p=a; //right
int  *p=&a; //error, (&a宸茬粡鏄竴涓寚鍚戞暣涓暟緇勭殑鎸囬拡)

2.涓簃ain鍑芥暟鎻愪緵榪斿洖鍊?br />main錛堬級
{}
闅愬惈鐫main榪斿洖鏁存暟錛?span style="color: red; ">涓涓繑鍥炴暣鏁扮殑鍑芥暟濡傛灉榪斿洖澶辮觸錛屽疄闄呬笂闅愬惈榪斿洖鏌愪釜“鍨冨溇”鏁存暟錛屽彧瑕佽鍊間笉琚敤鍒幫紝灝辨棤鍏崇揣瑕併?br />鐒惰岋紝鍦ㄦ煇浜涙儏鍐典笅錛宮ain鐨勮繑鍥炲煎嵈騫墮潪鏃犲叧绱ц錛屽ぇ澶氭暟C璇█瀹炵幇閫氳繃main鐨勮繑鍥炲鹼紝鏉ュ憡鐭ユ搷浣滅郴緇熻鍑芥暟鐨勬墽琛屾槸鎴愬姛榪樻槸澶?/span>璐?/span>銆傚鏋滀竴涓▼搴忕殑main鍑芥暟騫朵笉榪斿洖浠諱綍鍊鹼紝閭d箞鏈夊彲鑳界湅涓婂幓鎵ц澶辮觸銆傛墍浠ユ渶濂芥彁渚涜繑鍥炲?br />
3.杈圭晫璁$畻涓庝笉瀵圭О杈圭晫銆?br />閫傚悎c涓互涓嬫爣涓?寮濮嬬殑璁$畻銆?/span>

Snape 2012-06-24 23:53 鍙戣〃璇勮
]]>
chapter 1http://www.shnenglu.com/chenglong7997/archive/2012/06/23/179858.htmlSnapeSnapeFri, 22 Jun 2012 22:21:00 GMThttp://www.shnenglu.com/chenglong7997/archive/2012/06/23/179858.htmlhttp://www.shnenglu.com/chenglong7997/comments/179858.htmlhttp://www.shnenglu.com/chenglong7997/archive/2012/06/23/179858.html#Feedback0http://www.shnenglu.com/chenglong7997/comments/commentRss/179858.htmlhttp://www.shnenglu.com/chenglong7997/services/trackbacks/179858.htmlerror.
/*浼氳褰撳仛娉ㄩ噴鐨勫紑濮嬨傚簲璇=x / *p;
鎴栬厃 = x/(*p); 

2.濡傛灉涓涓暣褰㈠父閲忕涓涓瓧絎︿負鏁板瓧0.閭d箞榪欎釜甯擱噺浼氳褰撳仛8榪涘埗鏁般?img src ="http://www.shnenglu.com/chenglong7997/aggbug/179858.html" width = "1" height = "1" />

Snape 2012-06-23 06:21 鍙戣〃璇勮
]]>
欧美日韩精品久久久久| 亚洲欧美日韩久久精品| 久久综合九色综合网站| 久久国产精品99国产精| 香蕉久久一区二区不卡无毒影院| 久久99精品久久久久久水蜜桃| 久久精品人妻中文系列| 91麻豆精品国产91久久久久久| 久久亚洲国产欧洲精品一| 亚洲午夜久久久久妓女影院| 久久久久国产亚洲AV麻豆| 国产69精品久久久久777| 久久99久国产麻精品66| 99久久久国产精品免费无卡顿| 亚洲欧洲久久久精品| 久久国产热精品波多野结衣AV| 伊人热人久久中文字幕| 无码日韩人妻精品久久蜜桃 | 久久久久久亚洲精品不卡 | 久久久这里有精品| 久久久久人妻一区精品 | 久久免费的精品国产V∧| 久久青青草原国产精品免费| 午夜精品久久久久久| 精品久久久久久国产| 国内精品久久久久久99| 久久亚洲日韩看片无码| Xx性欧美肥妇精品久久久久久 | 99久久无色码中文字幕人妻| 久久精品嫩草影院| 久久国产免费观看精品3| 日韩人妻无码一区二区三区久久99| 99久久99久久| 久久久精品2019免费观看| 久久人人爽人人人人爽AV| 午夜精品久久久久久影视777| 久久青草国产精品一区| 伊人久久免费视频| 久久福利片| 久久精品一区二区影院| 国产午夜精品久久久久九九|