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"));
![](http://hi.csdn.net/attachment/201105/23/0_1306147962dYzo.gif)
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"));
![](http://hi.csdn.net/attachment/201105/23/0_1306147962dYzo.gif)
相关文章推荐
- test the difference between "DEFAULT NULL" and "DEFAULT 0"
- difference between "<" and "<<"
- What is the difference between angle bracket < > and double quotes " " while including header files
- DIFFERENCES BETWEEN PROCESSES, SESSIONS AND CONNECTIONS", version 8.1.7.4
- "Go to the Main Table Form" differences between Axapta 2.x and Dynamics AX 4
- Difference between "net start servicename" and "sc start servicename"
- The difference between "malloc" and "new"
- '/0'和"/0"的区别
- Difference between "select_catalog_role" and "select any dictionary"
- test the difference between "DEFAULT NULL" and "DEFAULT 0"
- test the difference between "DEFAULT NULL" and "DEFAULT 0"
- Visual Studio中“生成”与“重新生成”的区别(The difference between "build" and "rebuild")
- Difference between "su - $username" and "su $username"
- Windows - "The trust relationship between this workstation and the primary domain failed"
- C语言关于"0" '0' '\0'之间的区别。
- What is the difference between a = a * (2^3) and a = a << 3?
- What's the difference between a URI and a URL?
- what is the difference between "isempty"and "isnull"in the qt bool QString::isEmpty () const Retur.
- Q & A: The difference between hard and soft links