您的位置:首页 > Web前端

Difference between "/0" and '/0' and '0' and 0

2011-05-23 18:52 399 查看
To me, when doing C/C++:
0 would digit zero, that is, a numerical value.
'0' could be the character capital oh or the character zero. For example:
char word[10] = "Oxford";
char number[10] = "01234";
Depending on typeface used 'O' may look exactly like '0' making it difficult to tell them apart out of context.

'/0' is the null character used to terminate strings in C/C++. 这里是用转义字符的八进制表示的'/ddd'
'/0' = 0 =0x00=000= '/x00'='/000'  = NULL
"/0" is an empty string.  strlen("/0" ) = 0  "/0" 是空字符串,并不包任何字符,因为字符串就是以null character '/0'作为结束的
16进制常整数 0x开头 如:0xff
8进制常整数   0开头    如:0ff
 
printf("%sb/n","/0");
printf("%d/n",strlen("/0"));


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: