Skip to content

assignment10.c #33

@20urc3

Description

@20urc3

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions