NULL is never added to any array since NULL is a pointer value. Typically it is
#define NULL (void*(0))
THere is no way to get the size of an array unless it is statically allocated and the header that includes it defines the size or it is in the same module.
HEADER.H
extern int a[];
CCODE.C
int n = sizeof(a); // Returns n = 4 (pointer size)
int b[10];
int m= sizeof(b); // Returns m= 10 * sizeof(int)
Sachidananda Patnik
Feb 18th, 2006
Null Pointer is used for the recogniation of the strings. But to calculate the length of the integer array, simpaly we can use a clunter while inserting the value to the array and we can calculate the lenght.
Suppose
int *arr,i;
scanf("%d",&arr[i]);
counter++;
ali
Aug 2nd, 2007
The last character in strings is the null character '
Why don\'t we add null pointer at the end of array of integer?How can we calculate the length of array of integer?
Profile Answers by gau_bhatnagar Questions by gau_bhatnagar
Questions by gau_bhatnagar answers by gau_bhatnagar