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

  • 相关阅读:
    做才是得到
    常用工具汇总
    迎接2017
    新年礼物
    2017
    asp.net core 日志
    板子|无向图的割点
    11/06信竞快乐模拟赛
    动态规划复习
    894D
  • 原文地址:https://www.cnblogs.com/renyuan/p/2725661.html
Copyright © 2011-2022 走看看