zoukankan      html  css  js  c++  java
  • C++ lstrlen()

    关于lstrlen function,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms647492(v=vs.85).aspx

    以下代码摘自:http://blog.csdn.net/hczhiyue/article/details/6248229

    另外,可参考:http://blog.csdn.net/dongpanshan/article/details/7898574

    IDE: Code::Blocks 16.01

    操作系统:Windows 7 x64

     1 #include <windows.h>
     2 #include <iostream>
     3 
     4 using namespace std;
     5 
     6 int main(int argc, _TCHAR* argv[])
     7 {
     8     char str1[] = "I'm a Chinese.";
     9 
    10     // Determines the length of the specified string (not including the terminating null character).
    11     cout << lstrlen((LPCTSTR)str1) << " bytes" << endl;
    12 
    13     // Determines the length of the specified string (including the terminating null character).
    14     cout << sizeof(str1) << " bytes" << endl;
    15 
    16     return 0;
    17 }

    在Code::Blocks 16.01中的运行结果:

  • 相关阅读:
    Java ListIterator(迭代器)
    java 异常 throw
    java iterator(迭代器)
    java list
    type Iterator does not take parameters
    Java 容器的打印
    java 添加一组元素
    Java 容器的基本概念
    软件
    java 学习网站
  • 原文地址:https://www.cnblogs.com/Satu/p/8213869.html
Copyright © 2011-2022 走看看