IS it possible to define a zero sized array in c.if it is
possible how can the elements of that array can be
accessed.array index starts from zero,if it is possible to
define zero sized array how can be its first element can be
accesseed.

Answers were Sorted based on User's Feedback



IS it possible to define a zero sized array in c.if it is possible how can the elements of that arr..

Answer / k satish kumar reddy

it is not possible to define a zero size array in C. Because
we must declare the size of the array at the time of
declaration. If we declare zero size array like array[0] the
compiler shows an error.

Is This Answer Correct ?    15 Yes 6 No

IS it possible to define a zero sized array in c.if it is possible how can the elements of that arr..

Answer / crazzybouy

#include<stdio.h>

int main(){
int a[0];
printf("%d",sizeof(a));
}
~

Is This Answer Correct ?    10 Yes 11 No

IS it possible to define a zero sized array in c.if it is possible how can the elements of that arr..

Answer / palani222samy

ya it's possible to assign , elements can be access an the
store value, this value can be store as an the address so
easily we can find that value, first element can be assigned
as example c[0]=0,

Is This Answer Correct ?    2 Yes 6 No

IS it possible to define a zero sized array in c.if it is possible how can the elements of that arr..

Answer / slowdeath

no, it is not possible to define a array with 0 element,
the compiler will show an error message that array must
contain atleast one element

Is This Answer Correct ?    0 Yes 4 No

IS it possible to define a zero sized array in c.if it is possible how can the elements of that arr..

Answer / avtar singh

no it is not possible to define array with size 0 as
compiler shows a compilation error of array must contain
atleast one element;

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Interview Questions

main() { printf("\n %d %d %d",sizeof('3'),sizeof("3"),sizeof(3)); } wat is the o/p and how?

12 Answers   Tech Mahindra,


what is the role you expect in software industry?

2 Answers   HCL, Wipro,


How would you use the functions fseek(), freed(), fwrite() and ftell()?

0 Answers   Aspire, Infogain, TISL,


What is the difference between typedef and #define?

0 Answers  


read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50

4 Answers   TCS,






Write a C program that computes the value ex by using the formula ex =1+x/1!+x2/2!+x3+3!+………….

1 Answers  


#&#8206;include&#8236;<stdio.h> void main() { int i; for(i=5;0;i++) { printf("%d",i); } }

2 Answers   Facebook,


how to count no of words,characters,lines in a paragraph.

0 Answers  


with out using main how to execute the program?

2 Answers  


Explain low-order bytes.

0 Answers  


What is extern c used for?

0 Answers  


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

0 Answers   Genpact,


Categories