size of a datatype without using sizeof

后端 未结 21 1996
慢半拍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:02

    Try This:

     #include
    
    int main(){
    
      int *ptr = 0;
    
      ptr++;
      printf("Size of int:  %d",ptr);
    
      return 0;
    

提交回复
热议问题