锘??xml version="1.0" encoding="utf-8" standalone="yes"?>香蕉久久夜色精品国产2020,久久国产视频网,午夜精品久久久久久99热http://www.shnenglu.com/chenglong7997/category/19519.htmlzh-cnMon, 20 Aug 2012 07:17:45 GMTMon, 20 Aug 2012 07:17:45 GMT60Signed 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久久国产主播综合精品| 日本五月天婷久久网站| 国产精品9999久久久久| 久久久久久久99精品免费观看| 91久久香蕉国产熟女线看| 久久综合视频网站| 一本一道久久综合狠狠老| 精品久久久久香蕉网| 久久九九免费高清视频| 久久人人爽人人人人爽AV| 国产V综合V亚洲欧美久久| 欧美国产成人久久精品| 久久亚洲精品无码AV红樱桃| 精品免费久久久久国产一区| 伊人久久大香线蕉av不卡| 欧美777精品久久久久网| 久久午夜无码鲁丝片秋霞| 久久青草国产手机看片福利盒子| 一级做a爰片久久毛片看看| 久久婷婷久久一区二区三区| 久久天天躁狠狠躁夜夜avapp| 伊人色综合久久天天| 99久久人妻无码精品系列| 伊人久久大香线蕉AV色婷婷色| 久久久久综合国产欧美一区二区 | 国内精品人妻无码久久久影院导航| 久久亚洲中文字幕精品有坂深雪| 香蕉aa三级久久毛片| 国产高清美女一级a毛片久久w| 无码国内精品久久综合88| 91亚洲国产成人久久精品| 77777亚洲午夜久久多喷| 97视频久久久| 热久久国产欧美一区二区精品| 国产国产成人久久精品| 狠狠色丁香婷婷久久综合不卡| 久久精品无码午夜福利理论片| 性做久久久久久久| 久久久亚洲欧洲日产国码二区| 一本久久a久久精品亚洲| 人妻丰满AV无码久久不卡|