How to declare array of constant known size in C

1 Answer

0 votes
#include <stdio.h>
 
int main(void)
{
    int n[3]; 
    char ch[sizeof(double)]; 
    
    enum { SIZE = 13 };
    int arr[SIZE]; 
    
    printf("%lu\n", sizeof n); 
    printf("%lu\n", sizeof ch); 
    printf("%lu\n", sizeof arr); 
    
    return 0;
}

 
/*
run:

12
8
52

*/

 



answered Aug 23, 2016 by avibootz

Related questions

1 answer 151 views
1 answer 177 views
1 answer 75 views
2 answers 100 views
1 answer 190 views
190 views asked May 8, 2021 by avibootz
1 answer 183 views
...