gpt4 book ai didi

c++ - 努力获取 char* 中的字符数

转载 作者:行者123 更新时间:2023-11-30 01:22:03 25 4
gpt4 key购买 nike

<分区>

char* string = "hello there";

cout << sizeof( string ); // prints 4, which is the size of pointer
cout << sizeof( *string ); // prints 1, which is the size of char

如何获取字符串 (11) 中包含的字符数?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com