题中0为\,请问\0不是一个字符吗?为什么可以拆开,遇到\结束? \0 代表空字符?\a为什么不是一个控制符?这里为什么要加\...
\u5b57\u7b26\u4e32\u4e2d\u7684'\0'\u7b97\u4e00\u4e2a\u5b57\u7b26\u5417\u7b97ASCII\u4e3a0\uff0c\u5b83\u4e5f\u662f\u8981\u5360\u7528\u7a7a\u95f4\u7684\uff0c\u6bd4\u5982\u8bf4\u4f60\u5f00\u4e00\u4e2a\u5b57\u7b26\u6570\u7ec4\u6765\u5b58\u653e\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u6700\u540e\u4e00\u5b9a\u8981\u7559\u4e00\u4e2a\u7a7a\u95f4\u6765\u5b58\u653e'\0';
char a='\0'\u4e5f\u53ef\u4ee5\u5199\u6210char a=0;
\u4e24\u8005\u662f\u4e00\u6a21\u4e00\u6837\u7684\u3002'\0'\u548c0\u662f\u4e00\u4e2a\u4e1c\u897f\u7684\u4e24\u79cd\u5199\u6cd5\u3002'\0' \u662f\u4ece\u5b57\u6bcd\u7684\u89d2\u5ea6\u6765\u5199\uff0c0\u662f\u4ece\u6574\u6570\u7684\u89d2\u5ea6\u6765\u5199\u3002
\u6bd4\u5982\u8bf4\uff0cTab\u952e\u503c\uff0c\u6211\u53ef\u4ee5\u5199\u6210'\t'\uff0c\u4e5f\u53ef\u4ee5\u5199\u62109\u3002
\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u8981\u52a0\u659c\u6760\uff0c\u6309\u7167\u5b57\u6bcd\u7684\u89d2\u5ea6\u6765\u5199\u7684\u8bdd\uff0c\u5c31\u662f\u8981\u52a0\u659c\u6760\u7684\uff08\u5f3a\u5236\u8981\u6c42\u5fc5\u987b\u8fd9\u4e48\u5199\uff09\u3002
'\0'\u76f8\u5e94\u7684\u6574\u6570\u662f0\uff0c'\t'\u76f8\u5e94\u7684\u6574\u6570\u662f9\uff0c'0'\u76f8\u5e94\u7684\u6574\u6570\u662f30\uff0c
不可以拆开,\0是字符,在ASCII中是数值是0
绛旓細C璇█鐨勫瓧绗︿覆瑙勫畾浠ョ┖瀛楃缁撳熬锛屽洜姝ゅ簲璇ヨ瀛楃涓叉槸閬'\0'缁撴潫(杩欐槸涓绉嶄汉涓鸿瀹氾紝缂栬瘧鍣ㄩ伒瀹堣繖涓瀹)銆傚洜姝ゅ垽鏂瓧绗︿覆鐨勭粨鏉熶娇鐢'\0'鍜屼娇鐢0鏄病鏈夊尯鍒殑锛屽洜涓轰粬浠湰璐ㄤ笂閮芥槸0銆
绛旓細'\0'鍜岀┖鏍间笉鏄悓涓涓蹇点'\0'琛ㄧず瀛楃涓茬粨鏉熺锛屼唬琛ㄥ瓧绗︿覆缁撴潫锛岃岀┖鏍兼槸涓涓櫘閫氬瓧绗︼紝鏄剧ず鍦ㄦ枃鏈腑鍙互閫変腑銆'\0'鐨凙SCII鐮佷负0锛岀┖鏍肩殑ASCII鐮佷负32锛屼袱涓笉鏄悓涓涓瓧绗 鍦ㄨ绠楁満绋嬪簭涓氬父浣跨敤'\0'琛ㄧず瀛楃涓茬粨鏉燂紝绌烘牸涓烘枃鏈瓧绗︼紝浜岃呭畬鍏ㄤ笉鍚 ...
绛旓細'\0' 鏄瓧绗︿覆鐨勭粨鏉熺锛屼换浣曞瓧绗︿覆涔嬪悗閮戒細鑷姩鍔犱笂'\0'銆傚鏋滃瓧绗︿覆鏈熬灏戜簡鈥榎0鈥欒浆涔夊瓧绗︼紝鍒欏叾鍦ㄨ緭鍑烘椂鍙兘浼氬嚭鐜颁贡鐮侀棶棰樸傗榎0鈥欒浆涔夊瓧绗﹀湪ASCII琛ㄤ腑骞朵笉琛ㄧず闃挎媺浼暟瀛0锛闃挎媺浼暟瀛0鐨凙SCII鐮佷负48锛屸榎0鈥欒浆涔夊瓧绗︾殑ASCII鐮佸间负0锛屽畠琛ㄧず鐨勬槸ASCII鎺у埗瀛楃涓┖瀛楃鐨勫惈涔 鍏蜂綋鏉ヨ锛...
绛旓細杩欎釜闂鐪熺殑鎸烘湁鎰忔濈殑銆\0oo鏄爣蹇楄瀛楃鏄互鍏繘鍒跺畾涔夌殑銆備絾濡傛灉o涓嶆槸鍚堟硶鐨勬暟瀛楋紙搴旇鍦0-7)涔嬮棿锛屽氨浼氬拷鐣ヨ繖浜涙暟瀛楋紝鍙彇鏈鍚庝竴浣嶆暟瀛椼傛瘮濡俓092鍥犱负9涓嶅湪鏈夋晥鑼冨洿锛屾墍浠ヨ蹇界暐銆備笂杩板畾涔夊氨绛変环浜巆har s = '2';鍙互鍋氫釜瀹為獙锛宑har s='\095235235212';鐒跺悗printf("%c",s);鐪嬬湅锛屼竴鏍疯緭...
绛旓細'\0'鐨勭被鍨嬫槸char鍨嬪瓧绗,鑰屸0鈥欐槸int绫诲瀷鏁板硷紝'\0'杩樿〃绀洪亶鍘嗘墍鏈夛紝宸茬粡缁撴潫銆(*p == '0' && *(p+1) != '\0')琛ㄧず*p瀛楃涓蹭腑绗琾涓瓧绗︽槸0鑰岀p+1涓瓧绗涓嶆槸0鍗冲瓧绗︿覆娌℃湁缁撴潫锛堝彲鑳界敤鎴疯緭鍏ラ敊璇垨瀛楃涓虹┖锛夛紱(*p != '\0')琛ㄧず瀛楃涓蹭笉涓虹┖锛屽垯鍚戜笅璁$畻銆
绛旓細c璇█涓\0鈥涓嶆槸绌烘牸锛屾槸绌哄瓧绗︿覆銆'\0' 鏄瓧绗﹀父閲忥紝NULL 瀛楃锛孉SCII鐮佹暟鍊0锛鐢ㄤ綔瀛楃涓茬粨灏剧銆"\0" 鏄瓧绗︿覆锛岄噷闈鏈変竴涓鍐欏叆鐨勫瓧绗︿覆缁撳熬绗︼紝杩樻湁涓涓粯璁ょ殑瀛楃涓茬粨灏剧銆"\0" 瀛楃涓查暱搴︽槸0锛 鍗犲唴瀛 2 瀛楄妭銆傛楠岋細include<stdio.h> main(){ char s[]="\0";printf("%d...
绛旓細鍦 C 璇█涓紝瀛楃鍦ㄥ唴瀛樹腑鏄互 ASCII 鐮佺殑褰㈠紡瀛樺偍鐨勩'A' 鐨 ASCII 鐮佸兼槸 65锛'\375' 鏄竴涓鍏繘鍒剁殑瀛楃甯搁噺锛屽叾鍗佽繘鍒跺兼槸 253銆傚綋鎴戜滑瀵逛袱涓瓧绗﹁繘琛屽彇妯¤繍绠楁椂锛屽疄闄呬笂鏄浠栦滑鐨 ASCII 鐮佸艰繘琛屽彇妯¤繍绠椼傚洜姝わ紝鎴戜滑璁$畻鐨勬槸 65 % 253锛岃岃繖涓煎氨绛変簬 65锛屽洜涓 65 灏忎簬 253銆
绛旓細ascii鐮佹槸0锛涒 鈥欐槸绌烘牸锛屼唬琛ㄤ竴涓樉绀轰负绌虹櫧鐨勫瓧绗︼紝ascii鐮佷负32锛宎scii鐮佷腑鏈夊緢澶氫笉鍙瀛楃锛屼絾鏄兘鏈夎嚜宸辩殑鐙壒鎰忎箟銆傗溾濇槸绌哄瓧绗︿覆锛屽彧鍖呭惈涓涓'\0'鐨勫瓧绗︿覆锛屼絾鏄紝瀹冧笌鈥榎0鈥欑被鍨嬩笉鍚岋紝瀹冩槸鏁扮粍绫诲瀷锛岃'\0'鏄崟鐙殑涓涓瓧绗︺傛垜鎯充綘闂殑搴旇鏄涓変釜鍜岀涓涓殑鍖哄埆銆
绛旓細杈撳嚭鍒\0鎴 printf("aaa\0bbb");鐩磋兘杈撳嚭aaa printf("aaa\0102");0102涓8杩涘埗鐨66 鍗矪 鎵浠ヨ緭鍑轰负aaaB
绛旓細浠ュ強鏌愮褰㈠紡鐨勬ā鍧楀寲/鍒嗗埆缂栬瘧鏈哄埗銆傚湪杩欎簺鍩虹涓婏紝浜轰滑鎵杩涜鐨勭紪绋嬫椿鍔ㄥ熀鏈槸閫氳繃鍐欑敤浜庝笉鍚岀洰鐨勭殑鍔熻兘鍑芥暟/杩囩▼鏉ュ疄鐜帮紝鏁呯О涓衡滈潰鍚戣繃绋嬧濄傞潰鍚戣繃绋嬪紑鍙戞柟寮忔槸瀵硅绠楁満搴曞眰缁撴瀯鐨勪竴灞傛娊璞★紝瀹冩槑鏄炬妸绋嬪簭鐨勫唴瀹瑰垎涓烘暟鎹拰鎿嶇旱鏁版嵁鐨勬搷浣滀袱閮ㄥ垎銆傝繖绉嶇紪绋嬫柟寮忕殑鏍稿績闂鏄暟鎹粨鏋勫拰绠楁硶鐨勫紑鍙戝拰浼樺寲銆侰 ...