0

Why can't we declare a variable length array in struct in C?

It's usual to get the length of an array and then declaring it. Then why can't we do the same in a struct? it's like... int arr[n]; is acceptable but struct number{ int arr[n]; } is not acceptable. In both n is taken from the user using scanf before declaring the array. So why does the compiler not accept the second form?

5th May 2018, 7:41 AM
srihitha reddy
srihitha reddy - avatar
1 Antwort