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
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 |
Answer / crazzybouy
#include<stdio.h>
int main(){
int a[0];
printf("%d",sizeof(a));
}
~
| Is This Answer Correct ? | 10 Yes | 11 No |
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 |
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 |
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 |
Find the largest number from the given 2 numbers without using any loops and the conditional operator.
WHY DO WE USE A TERMINATOR IN C LANGUAGE?
when to use : in c program?
There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.
There seem to be a few missing operators ..
why we are using semicolon at the end of printh statment
What are conditional operators in C?
Predict the output or error(s) for the following: 25. main() { printf("%p",main); }
12345 1234 123 12 1
struct ptr { int a; char b; int *p; }abc; what is d sizeof structure without using "sizeof" operator??
How to add two numbers without using arithmetic operators?
18 Answers College School Exams Tests, e track, Infosys, Pan Parag, Sapient, TCS,
What is the difference between array and structure in c?