Hi guys, im struggling to find a solution to why the below code is giving me the error
cc linktest3.c -o linktest3
linktest3.c:18: error: expected ‘)’ before ‘record’
linktest3.c: In function ‘main’:
linktest3.c:29: warning: assignment makes pointer from integer without a cast
make: *** [linktest3] Error 1
Ive sat and looked at this for a good while and its starting to give me a head ache. I have commented line 18.
CODE
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
typedef struct student {
char ID[10];
char Name[50];
char Date[10];
float Min_temp;
float Max_temp;
} record;
typedef struct node_record {
struct student data;
struct node_record *next;
} NODE;
NODE *record_create(data record) { /*line 18*/
NODE *node;
if(!(node=malloc(sizeof(NODE)))) return NULL;
node->data = record;
node->next = NULL;
return node;
}
int main() {
NODE *record_list;
record_list = record_create((record) {"12","bob","12/12/12",3,4});
return 0;
}
If anyone has any pointers as to why this is happening I would be very greatful.
This post has been edited by jv1986: 21 May, 2008 - 05:29 AM