|
-
Oct 1st, 2006, 11:03 PM
#1
Thread Starter
Hyperactive Member
structures as parameter
it says argument list syntax error in the line colored red...whats wrong with my code??
Code:
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
int x;
struct node *next;
}node;
node nd;
void insert_list(nd **head, int num)
{
nd *p, temp;
temp = (nd *)malloc(sizeof(nd));
temp->x = num;
}
I want to learn more 
grace 
-
Oct 2nd, 2006, 12:37 AM
#2
Re: structures as parameter
nd is not a type, it is a variable. You sould change it to
void insert_list(node **head, int num)
The same problem occurs on the next two lines.
Or maybe the nd should be a typedef?
-
Oct 2nd, 2006, 03:24 AM
#3
Thread Starter
Hyperactive Member
Re: structures as parameter
 Originally Posted by twanvl
nd is not a type, it is a variable. You sould change it to
void insert_list(node **head, int num)
The same problem occurs on the next two lines.
Or maybe the nd should be a typedef?
thanks i got it
I want to learn more 
grace 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|