This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem with gcc compiler in the mac os X version 10.4.6


Greetings

I am currently working on an assignment for my C
programming class and I run onto a compilation error
on my mac that I cannot resolve.  I send the code to
my professor who was able to compile and run it
successfully using microsoft visual studio.   
I am including a copy of the program and the
compilation error I received in the hope that someone
can help me resolve what appear to be a compiler
related problem:

include <stdio.h>
#define CSIZE 4
void getScore(struct student stuArray[], int n);

struct name {
        char fname[20];
        char lname[20];
};

struct student{
        struct name fullname;
        float grade[3];
        float average;
};

int main(void)
{
        struct student stuArray[CSIZE] = {{{"Joey",
"Benitez"},0,0,0,0},
                                          {{"Dan",
"Wilson"},0,0,0,0},
                                          {{"Sam",
"Parker"},0,0,0,0},
                                          {{"Kareen",
"White"},0,0,0} };

        getScore(stuArray, CSIZE);
}
void getScore(struct student stuArray[], int n)
{
        int status = 0;
        int i;

        for( i = 0; i <= CSIZE; i++)
        {
                printf("Enter the three scores for %s
%s\n", stuArray[i].fullname.fname,
stuArray[i].fullname.lname);
        }

}


i compile the program using the following command:

cc -o assig5 assig5.c

and got the following errors

assig5.c: In function `main':
assig5.c:23: warning: passing arg 1 of `getScore' from
incompatible pointer type
assig5.c: At top level:
assig5.c:26: error: conflicting types for `getScore'
assig5.c:3: error: previous declaration of `getScore'





 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]