-
Notifications
You must be signed in to change notification settings - Fork 297
Open
Description
The assignment10.c is always returning "10" as value the way you did it.
#include <stdio.h>
int main()
{
int array[10] = {0,1,2,3,4,5,6,7,8,9};
printf("The array has %d elements.\n",sizeof(array) / sizeof(array[0]));
return 0;
}
The code should be:
#include <stdio.h>
int main()
{
int array[] = {0,1,2,3,4,5,6,7,8,9};
printf("The array has %d elements.\n",sizeof(array) / sizeof(array[0]));
return 0;
}
Metadata
Metadata
Assignees
Labels
No labels