hi,
i'm trying to understand the use of pointer to structs, calling by address, etc.
can get the declarations right:
Code:
month* AddMonth(month *monthPtr,month **lastMonth,char[MONTHCODE] name)
{
//allocate month in mem
monthPtr=(month*)realloc(month,sizeof(month));
//check
CheckAlloc((void*)*monthPtr);
//move last month pointer
(*lastMonth)++;
//add new month name to newly created month
MyStrcpy((*lastMonth)->name,name);
return monthPtr;
}
the declaration of this function and the structs:
Code:
month* AddMonth(month *monthPtr,month **lastMonth,char[MONTHCODE] name);
typedef struct {
int dayNum;
int numOfTasks;
char *task;
} day;
typedef struct {
char name[3];
day *dayInMonth;
} month;
the compiler is saying things like: syntax error : missing '{' before '*'
not sure what i've done wrong
HELP!
thanks