0
点赞
收藏
分享

微信扫一扫

C++ 字符串长度和字符数组占用空间数

玉字璧 2022-04-16 阅读 40
c++

/*  
输入

输出
字符串长度和字符数组占用空间数

程序输出 11,17 */

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char s[]="a1\t\0527c\28\"\x4g\0de\8\0";
    printf("%d,%d\n",strlen(s),sizeof(s));
    return 0;
}
举报

相关推荐

0 条评论