How do I determine size of array in C without using <string.h> library.

Ask a question+

I know to use strlen but i want to know how to find a array’s size.

slamsal 10
add comment

1 Answer


//before using this example please uncomment the below line
// #include <stdio.h>
int main()
char str[100],i;
printf(“Enter a string: \n”);
for(i=0; str[i]!=’\0’; ++i);
printf(“\nLength of input string: %d”,i);
return 0;

Ashish 0
add comment

Your Answer