size of a datatype without using sizeof

后端 未结 21 2011
慢半拍i
慢半拍i 2020-12-01 02:34

I have a data type, say X, and I want to know its size without declaring a variable or pointer of that type and of course without using sizeof oper

21条回答
  •  忘掉有多难
    2020-12-01 03:03

    # include
    
    struct node
    {
      int a;
      char c;
    };
    
    void main()
    {
       struct node*ptr;
       ptr=(struct node*)0;
       printf("%d",++ptr);
    }
    

提交回复
热议问题