zoukankan      html  css  js  c++  java
  • 占用空间的大小

      void main()
     {
        char s[]="Welcometohengtian";

        printf("%s%d\n",(s+7),sizeof(s));

        char s[20]="Welcometohengtian";
        printf("%s%d\n",(s+7),sizeof(s));

        int a=4;
        printf("%d\n",sizeof(int));

        char *p="renyuan";
        printf("%d\n",sizeof(p));

        int b[5]={0};
        printf("%d\n",sizeof(b));

      }

    输出的结果是:tohengtian18

                  tohengtian20

            4

            4

           20

     

      void main()
     {
        char s[20]="Welcometohengtian";
         printf("%s%d\n",(s+7),sizeof(s));
      }

    输出的结果是:tohengtian20

     

    public class Test9 {

      public static void main(String[] args) {
        String hello="hello";
        String hel="hel";
        String lo="lo";
        System.out.println(hello=="hel"+"lo"); ///true????????????
        System.out.println(hello=="hel"+lo);
      }

    }

    输出的结果是:true  false

  • 相关阅读:
    JavaScript数据结构——模仿ES6中定义的类似的Set类
    webpack简单的项目配置发生的错误
    三国
    把握中国经济的大局与动力
    人生道路
    C++
    https://计算机等级分类总结
    https://计算机四级
    https://计算机三级
    https://计算机二级
  • 原文地址:https://www.cnblogs.com/renyuan/p/2725661.html
Copyright © 2011-2022 走看看