Hi, could someone take a quick look at this C code and see why I get the compiler error? It is a function for entering details into a calendar structure, and should create one node, i.e. one 'event' on the calendar.
struct event enter_key(void)
{
int day,month,year,starttime,endtime,length;
char* descp;
struct event* n;
printf("Enter Day:\n");
scanf("%d", &day);
printf("Enter Month:\n");
scanf("%d", &month);
printf("Enter Year: \n");
scanf("%d", &year);
printf("Enter starttime:\n"); scanf("%d", &starttime);
printf("Enter endtime:\n");
scanf("%d", &endtime);
printf("Enter Description: \n");
scanf("%s", &descp);
n=mkevent(day, month, year, starttime, endtime, &descp);
When trying to compile I received this message:
newpro.c:115: warning: passing argument 6 of 'mkevent' from incompatible pointer type
Could anyone tell me if I am declaring the pointer wrongly, or if I should allocate space for the 'descp' pointer, or have I tried to create a node in the structure in the wrong manner?
Thanks for reading, C newbie.