This is my problem...i've got this code(creating a list)
typedef struct node
{
int pid;
int runtime;
struct node *next;
}job;
int main()
//code
job *first = NULL;
job *last = NULL;
job *newnode;
//code
//from here
if( first == NULL )
{
first = last = newnode;
newnode->next = NULL;
}
else
{
last->next = newnode;
last = last->next;
}
// to here
So i wanted to do the part between from here to here in a function(so it would look better) And i did this..i created a function
void funct(job ** pfirst, job **plast, job*newnode);
in main instead of the strong part i use:
funct(&first, &last, newnode);
and the function was like this
void funct(job ** pfirst, job **plast, job*newnode)
{
if(*pfirst == NULL)
{
*pfirst = *plast = newnode;
newnode->next = NULL;
}
else
{
*plast->next = newnode;//<----
*plast = *plast->next;//<----
}
}
The error is in the arrow and sais not part of a struct..