I read the rules, and no i'm not asking anyone to do my homework...I want to know what i'm doing wrong with these structure arrays. I've tried to figure it out but i still can't get it. Here's the code:

Code:
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>

#define MAXSIZE 80

typedef struct {
    char name[80];
    double diam;
    double dist;
    int moons;
} myVar;


void printPlanets( myVar planetInfo[] )
{
    int i;

    for( i = 0; i < 8; i++ )
    {
        printf("Planet %d:\n", i);
        printf("\tname: %s\n", planetInfo[i].name);
        printf("\tdiameter: %g\n", planetInfo[i].diam);
        printf("\tdistance to the Earth: %g\n", planetInfo[i].dist);
        printf("\tnumber of moons: %d\n", planetInfo[i].moons);
    }
}

int main( int argc, char *argv[] )
{
    myVar planets[7];
    int i;
    FILE *in;

    if( argc == 2 )
    {
        in = fopen(argv[2], "r");
    }
    else
    {
        in = stdin;

    for( i=0; i < 8; i++ )
    {
        printf("Please enter the name of a planet: ");
        fgets(planets[i].name, MAXSIZE, in);
        printf("Please enter the diameter of the planed (km.): ");
        scanf("%g", planets[i].diam);
        printf("Please enter the planet's distance from the Earth: ");
        scanf("%g", planets[i].dist);
        printf("Please enter the number of moons for the planet: ");
        scanf("%d", planets[i].moons);

        if( i == 7 )
        {
            printf("Thank you, you entered the following data:\n");
        }
    }
    }

    printPlanets(planets);

    return 0;
}