how do you put struct pointers into functions?

Discussion in 'C' started by SORAKH2756, Sep 4, 2010.

  1. SORAKH2756

    SORAKH2756 New Member

    Sep 4, 2010
    Likes Received:
    Trophy Points:
    This is my struct

    typedef struct{
    char first[20];
    char last[20];
    int nums[6];
    this is my function prototype

    void writeRecord (RECORD* , FILE*, int);
    this is my functions

    void writeRecord (RECORD* people, FILE* fp, int num_people){
    in my main i put
     	RECORD* people;
    people = (RECORD*) malloc(num_people*sizeof (RECORD));
    writeRecord(people, fp, num_people); 
    can you guys tell me where i'm going wrong.

    these are the errors i get in microsoft visual c++ 2008

    these all point to the prototype
    syntax error: ')'
    syntax error: ','
    syntax error: missing ')' before '*'
    syntax error: missing '{' before '*'

    these point to the function
    writeRecord: redifinition; different basic types

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice