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

Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

0 Answers   InterGraph,


how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y

4 Answers   TCS,


write an interactive program to generate the divisors of a given integer.

7 Answers   TCS,


C program to read the integer and calculate sum and average using single dimensional array

0 Answers  


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

0 Answers  






how should functions be apportioned among source files?

0 Answers  


Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.

3 Answers   Google,


what is the output of printf("%d",(scanf("%d",10));

10 Answers  


#include<stdio.h> #include<conio.h> void main() {clrscr(); char another='y'; int num; for(;another=='y';) { printf("Enter a number"); scanf("%d",&num); printf("squre of %d is %d",num,num*num); printf("\nwant to enter another number y/n"); scanf("%c",&another); } getch(); } the above code runs only one time.on entering 'y' the screen disappeares.what can i do?

3 Answers  


Which is better oop or procedural?

0 Answers  


what is difference between procedural language and functional language ?

4 Answers   Wipro,


How to explain the final year project as a fresher please answer with sample project

0 Answers  


Categories