#include <iostream>
#include
<cctype> //为了使用strlen
#include <windows.h> //为了使用lstrlen

using namespace std;

int main()
{
char str[12] = "hello";
wchar_t strw[
12] = L"hello";

cout
<< strlen(str) << endl; //5
//cout << lstrlen(strw) << endl; //5
//cout << lstrlen((LPCWSTR)str) << endl; //3
cout << sizeof(str) << endl; //12

return 0;
}

相关文章:

  • 2021-09-13
  • 2021-08-20
  • 2021-10-05
  • 2021-06-23
  • 2021-10-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-06-02
  • 2021-07-02
  • 2021-08-22
相关资源
相似解决方案