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

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"));

image

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值