$0.88

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

Ask a question+
0

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

slamsal 10
add comment

1 Answer

0

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

Ashish 0
add comment

Your Answer